@doubledigit/cli
v0.15.0
Published
CLI for Double Digit local setup and extension management.
Readme
@doubledigit/cli
CLI for Double Digit local setup, project bootstrapping, extension management, and database workflows.
Double Digit is a pluggable Next.js/Payload developer control plane. The CLI is the supported command surface for creating a new Double Digit project and managing an existing local workspace.
Usage
Run the published package directly:
npx @doubledigit/cli@latest init my-project
pnpm dlx @doubledigit/cli init my-projectInside a Double Digit project, use the repo-local shortcut:
pnpm dev
pnpm dd doctor
pnpm onboard
pnpm onboard -- --no-run
pnpm dd actions component-hub
pnpm dd actions component-hub init temp-project --framework remotionIf installed globally, the binary is available as dd:
dd dev
dd doctor
dd onboard
dd onboard --no-run
dd actions component-hub
dd actions component-hub init temp-project --framework remotionRequirements
- Node.js 20 or newer
- pnpm 9 or newer
Enable pnpm through Corepack when needed:
corepack enableCore Commands
dd init <project-name> # scaffold a new Double Digit project
dd doctor # check local prerequisites and project health
dd onboard # prepare env, dependencies, DB, migrations, types, and start
dd onboard --no-run # setup only
dd run # lower-level runtime bootstrap/start command
dd dev # start DB + app without migrations or seed data
dd db status # inspect migration state
dd db migrate # run migrations
dd db create <target> <name> # create a migration for shared or micro-app schema
dd actions <app> [action] # discover and invoke micro-app actions
dd add <source> # install an extension
dd sync # regenerate workspace registries
dd list # list discovered micro-apps
dd enable <name> # enable a micro-app
dd disable <name> # disable a micro-app
dd remove <name> # remove a micro-app package and wiring
dd info <name> # show detailed extension metadata
dd outdated # compare marketplace installs against cached catalogs
dd reconcile # detect registry, lock file, and package drift
dd marketplace <subcommand> # manage marketplace registrations
dd browse # browse marketplace extensionsadd is also available as install, and remove is also available as uninstall.
New Project Bootstrap
npx @doubledigit/cli@latest init my-project --yes
cd my-project
pnpm onboardUseful init options:
--yesskips prompts and uses defaults.--runbootstraps and starts the app after scaffolding.--skip-installskips dependency installation.--no-gitremoves the cloned.gitdirectory from the generated project.
Existing Project Setup
Use onboard for first-time setup and startup:
pnpm onboardPass --no-run when you want setup-only work:
pnpm onboard -- --no-runLeave DATABASE_URL empty in apps/main-app/.env to use the default CLI-managed embedded PostgreSQL flow. Provide DATABASE_URL through the environment or .env when using your own PostgreSQL instance.
Use dd dev when you want the app and database ready without running migrations or seed data. It defaults to port 3000 and accepts --port, for example:
dd dev --port 3000Action Invocations
Use dd actions to discover or call enabled micro-app actions through the running app. External projects should use the published package through npx @doubledigit/cli@latest and should not assume a global dd binary exists:
npx @doubledigit/cli@latest actions component-hub
npx @doubledigit/cli@latest actions component-hub init temp-project --framework remotion --yes
npx @doubledigit/cli@latest actions component-hub init html-project --framework hyperframe --yes
npx @doubledigit/cli@latest actions component-hub list-components --framework remotion --limit 5
npx @doubledigit/cli@latest actions component-hub search-components --framework hyperframe --query "animated chart" --limit 5
npx @doubledigit/cli@latest actions component-hub register-component --json-file component.jsonComponent Hub uses the canonical component-hub action command. init and add are handled locally by the CLI because they create or modify files on the caller's machine. Other actions, such as search and registry lookup, call the configured Double Digit app over HTTP. The old remotion-hub action name remains a legacy alias.
Authentication
Public catalog actions can still run without credentials. Project-scoped actions and private deployments require either an interactive login or an API key:
npx @doubledigit/cli@latest login --url https://your-double-digit-app.example
npx @doubledigit/cli@latest whoami --url https://your-double-digit-app.example
npx @doubledigit/cli@latest org list --url https://your-double-digit-app.example
npx @doubledigit/cli@latest org use acme --url https://your-double-digit-app.example
npx @doubledigit/cli@latest actions component-hub list-projects --org acme --url https://your-double-digit-app.exampledd login stores a per-host bearer credential under the user config directory (~/.config/doubledigit/credentials.json on Linux/macOS, %APPDATA%\doubledigit\credentials.json on Windows) with private file permissions where supported. dd logout removes the stored host credential.
CI and agent automation should use an API key created from the app admin security dashboard at /admin/security/api-keys:
DD_API_KEY=dd_... DD_ORG=acme npx @doubledigit/cli@latest actions component-hub list-projects --url https://your-double-digit-app.exampleAuth header resolution is DD_API_KEY or DD_TOKEN first, then the stored login token. Active organization resolution is --org, then DD_ORG, then the stored default selected by dd org use.
Pass --framework remotion|hyperframe when the target framework is known. Remotion remains the default for compatibility and creates Remotion's Hello World starter so remotion studio opens with a visible composition. HyperFrames init requires Node.js 22 or newer and uses npx hyperframes preview as its dev command.
Pass --skip-framework-create when adding Component Hub files to an existing project. --skip-remotion-create and --hub-only remain compatibility aliases.
After init, the CLI attempts to install framework skills and the Double Digit Component Hub skill from the created project directory. The retry command list depends on the selected framework; examples include:
npx skills add remotion-dev/skills --all
npx skills add heygen-com/hyperframes
npx skills add crystalphantom/double-digit --skill dd-component-hub --agent '*' --yesPass --skip-skills to skip skill installation. If skill installation fails, init still completes the project scaffold and prints exact retry commands. Use --yes for agent-run or scripted init flows; -y and --non-interactive are accepted compatibility aliases and are forwarded to nested framework scaffolds where supported.
For HyperFrames, non-interactive init accepts the framework skill defaults by installing animejs for all agents without prompting.
Register a component with simple JSON:
npx @doubledigit/cli@latest actions component-hub register-component --json-file component.jsonMinimal component.json:
{
"title": "Animated Chart",
"slug": "animated-chart",
"namespace": "doubledigit",
"framework": "remotion",
"kind": "component",
"description": "Animated chart scene.",
"tags": ["chart", "animation"],
"code": "export function AnimatedChart() { return null; }",
"metadata": {}
}When no --registry, --url, or --app-url is passed, Component Hub init writes a registry URL from exported DD_APP_URL, APP_URL, NEXT_PUBLIC_APP_URL, or BETTER_AUTH_URL; then the release-configured hosted app URL; then http://localhost:3111 for local development builds.
For HTTP-backed actions, the command resolves the app URL from exported DD_APP_URL, APP_URL, or BETTER_AUTH_URL; then local env-file DD_APP_URL; then the release-configured hosted app URL. It prints JSON responses to stdout. It also reads .env, .env.local, apps/main-app/.env, and apps/main-app/.env.local; exported shell values take precedence.
The published CLI embeds a hosted default from DD_ACTIONS_DEFAULT_APP_URL during the @doubledigit/cli package build, falling back to DD_APP_URL, NEXT_PUBLIC_APP_URL, or BETTER_AUTH_URL. Localhost values are not baked into the generated package default, but DD_APP_URL remains available as a runtime override for a specific invocation.
The hosted Double Digit app is the default for npm users:
npx @doubledigit/cli@latest actions component-hubThis hosted default does not require a local checkout or running app.
Before relying on the hosted default in automation, run discovery as a preflight. If the hosted action endpoint returns HTTP 500 or is unreachable, use DD_APP_URL or --url to target a local or self-hosted Double Digit app until the hosted Component Hub endpoint is healthy.
Local development or self-hosted environments should override the target explicitly:
DD_APP_URL=http://localhost:3111 npx @doubledigit/cli@latest actions component-hubIn GitHub Actions or another CI/CD runner, provide DD_ACTIONS_DEFAULT_APP_URL or DD_APP_URL through the runner environment, variables, or secrets when building or publishing the CLI package. Do not rely on a local env file being present in CI.
GitHub or Infisical secrets are CI/CD inputs only. A local npx @doubledigit/cli@latest ... command sees your shell environment and local env files, not repository secrets.
Links
- Repository: https://github.com/crystalphantom/double-digit
- Issues: https://github.com/crystalphantom/double-digit/issues
- Getting started: https://github.com/crystalphantom/double-digit/blob/main/docs/getting-started.md
- Architecture: https://github.com/crystalphantom/double-digit/blob/main/docs/architecture.md
