CLI tool for scaffolding AuthOS integrations
npm install @drmhse/authos-cli

CLI tool for scaffolding AuthOS authentication components in your project.
``bash`
npm install @drmhse/authos-cli -g
Or use without installing globally:
`bash`
npx @drmhse/authos-cli init
Initialize AuthOS in your project. This command detects your framework (React, Next.js, Vue, Nuxt) and sets up the appropriate configuration.
`bash`
authos init
The init command will:@drmhse/authos-react
1. Detect your framework from package.json dependencies
2. Install the appropriate AuthOS adapter package ( or @drmhse/authos-vue)
3. Set up the AuthOS provider/plugin in your app
Generate and add AuthOS components to your project.
`bash`
authos add
Available templates:
- login-form - Styled login form with email/password and MFA supportorg-switcher
- - Dropdown for switching between organizationsuser-profile
- - User avatar button with dropdown menu
`bashInitialize AuthOS in a Next.js project
authos init
$3
`bash
Initialize AuthOS in a Nuxt project
authos initAdd components
authos add login-form
authos add org-switcher
authos add user-profile
`Templates
$3
A styled login form component with:
- Email and password fields
- MFA (TOTP) support
- Loading states
- Error handling
$3
A dropdown component for switching between organizations when a user belongs to multiple organizations.
$3
A user avatar button with:
- Avatar display (with fallback to initials)
- Dropdown menu showing user info
- Sign out functionality
Programmatic Usage
You can also use the CLI programmatically:
`ts
import { initCommand, addCommand, getAvailableTemplates } from '@drmhse/authos-cli';// Get available templates
const templates = getAvailableTemplates();
console.log(templates); // ['login-form', 'org-switcher', 'user-profile']
// Initialize AuthOS
await initCommand({
projectDir: process.cwd(),
framework: 'next'
});
// Add a component
await addCommand({
projectDir: process.cwd(),
template: 'login-form'
});
`Troubleshooting
$3
If
authos init fails to detect your framework:1. Ensure you are in the root directory of your project (where
package.json is).
2. Manually specify the framework when initializing:`bash
For Next.js/React
authos init --framework nextFor Nuxt/Vue
authos init --framework nuxt
`$3
If
authos add fails to write files:1. Check that you have a
components/` directory in your project.MIT © DRM HSE