Commands Reference
The DeesseJS CLI command reference.
The CLI has seven top-level command groups: template, block, add, cache, organization, update, and auth. The template group also contains publish and releases. Catalog listing requests use the separate organization template request-listing command.
See Managed releases for publishing, storage, access, version, and initialization behavior.
Use deessejs --help or deessejs <command> --help to see the options available in the installed version. deessejs --version prints the installed version.
Commands that support both --verbose and --json emit machine-readable JSON to stdout by default. Use --verbose for human-readable output. When users pass both flags, --json wins. Prompts and diagnostics go to the standard error stream. This keeps the JSON output available for scripts.
deessejs list
Fetch templates from the public registry, including published community templates, and emit a compact JSON response by default.
deessejs listFlags
| Flag | Effect |
|---|---|
--category <name> | Filter to a single category. Unknown categories yield an empty list (not an error). |
--verbose | Render the template table for human reading. |
--json | Emit { templates: [...] }. JSON is the default and this flag overrides --verbose. The array includes published community templates. |
Output
The human-readable table columns are slug, name, category, and license. The footer prints the count and a hint about --category and --json.
Exit codes
0: success.1:network_error(registry could not be reached),parse_error(registry response did not match the v1 contract),internal.
Examples
deessejs list
deessejs list --category web
deessejs list --json | jq '.templates[].slug'deessejs info <slug-or-github-url>
Show validated fields from a template's deesse-template.json, then print the install command.
deessejs info next-app-starter
deessejs info https://github.com/owner/repository --ref mainArguments
| Argument | Description |
|---|---|
<slug-or-github-url> | Catalog template identifier, or a GitHub URL that uses HTTPS and points to the repository root. |
Flags
| Flag | Effect |
|---|---|
--ref <branch> | Inspect a branch or other Git ref. Defaults to the repository's default branch. |
--verbose | Show descriptor details in a human-readable format. |
--json | Emit { descriptor, source }; JSON is the default and this flag overrides --verbose. |
Output
A catalog slug and a direct GitHub URL show the same descriptor fields. The output includes the title, name, description, project type, version, optional author, license, category, labels, and source repository. JSON output includes the complete normalized descriptor.
Both input forms require a valid root deesse-template.json. For a catalog slug, the CLI uses a lightweight lookup instead of fetching the GitHub-enriched template listing. The info command reads the descriptor through GitHub's Contents API without downloading or inventorying the full repository. It checks the descriptor schema, declared repository, and include/exclude patterns. The command exits with an error if GitHub returns no descriptor or an invalid one. The init command resolves an immutable commit and checks any declared source ref before copying files.
Community templates use their approved source revision automatically. Passing --ref for a community template is rejected.
The formatted view ends with the matching install command:
Install: deessejs init next-app-starter
Install: deessejs init https://github.com/owner/repositoryExit codes
0: success.1:not_found(slug doesn't exist in the registry. The error hints at the closest matches),network_error,parse_error,template_invalid,internal.
deessejs init <slug-or-github-url>
Create a project from a template descriptor, detect the package manager, and install dependencies.
deessejs init next-app-starter
deessejs init https://github.com/owner/repositoryArguments
| Argument | Description |
|---|---|
<slug-or-github-url> | Catalog template identifier, or a GitHub URL that uses HTTPS and points to the repository root. |
Flags
| Flag | Effect |
|---|---|
--pm <name> | Override detected package manager. One of pnpm, npm, yarn, bun. |
--dir <path> | Target directory. Resolves relative to the current working directory. Default: ./<slug>. |
--ref <branch> | Git ref to use. Default: the repository's default branch. |
--no-install | Skip the install step. Useful for CI or pre-baked Docker images. |
--force | Use an existing empty target directory. Existing files stay intact. |
--verbose | Show human-readable initialization details and the package manager's full output during installation. By default, the command returns JSON. |
--json | Emit { ok, slug, dir, ref, installed }. When installation runs, the result includes packageManager. Handled CLI errors return { ok: false, code, message, hint }. This flag takes precedence over --verbose. |
--organization <slug> | Resolve an organization-owned managed template in that organization. |
Package manager detection
When you omit --pm, the CLI checks the generated project in this order:
- The
packageManagerfield inpackage.json(Corepack convention, such aspnpm@9.0.0orbun@1.1.0). The CLI uses the leading tool name and ignores the version. - The CLI checks these files in order:
pnpm-lock.yamlselects pnpm,bun.lockbselects bun,yarn.lockselects yarn, andpackage-lock.jsonselects npm.
If neither source identifies a package manager, the CLI creates the project without installing dependencies. Human-readable output asks you to install them manually. Pass --pm <name> to choose a package manager and run its install command.
Behaviour
- Resolve a catalog slug through the registry, or parse a GitHub repository URL directly. Published community templates use their approved revision and reject
--ref. - Resolve the requested ref to an immutable GitHub commit, then download its source archive.
- Require
deesse-template.jsonand check its contents. Use its include and exclude patterns to select project files. Both input forms follow this path, with no clone fallback. - Choose the target directory (
./<slug>for catalog entries or./<repository>for direct URLs), unless you pass--dir. - Materialize the selected files. If the directory exists and you didn't pass
--force, the CLI returnstarget_exists. With--force, the CLI expects an existing empty target directory. - Detect the package manager and run its install command (
pnpm install,npm install,yarn install, orbun install). The CLI hides install output by default. Pass--verboseto show it. If the CLI finds no manager, project creation still succeeds and installation stops. Verbose output also reports the resolved source, ref, target directory, commit, and number of selected files, even when--no-installskips installation.
Exit codes
0: success (created and installed, or created without installation when you pass--no-install).1: public codes (not_found,network_error,parse_error).1: internal codes (still exit 1, but with a differentcodefield if you pass--json):template_invalid,invalid_target,target_exists,target_not_empty,materialize_failed,install_failed,internal.
Examples
# Default: scaffold into ./next-app-starter
deessejs init next-app-starter
# Custom directory
deessejs init next-app-starter --dir ./apps/web
# Force pnpm even if the template ships yarn.lock
deessejs init next-app-starter --pm pnpm
# Use a feature branch without installing
deessejs init next-app-starter --ref feat/new-thing --no-install
# Machine-readable output is the default
deessejs init next-app-starter --no-install | tee clone-result.json
# Human-readable details
deessejs init next-app-starter --no-install --verbose
# Explicit JSON keeps JSON when combined with --verbose
deessejs init next-app-starter --no-install --verbose --json
# Initialize a private organization template
deessejs init starter --organization acme --no-installManaged template and block releases
Publishing commands emit one JSON result by default. Use --verbose for a short human-readable confirmation. --json explicitly selects JSON and overrides --verbose.
deessejs template publish --slug starter --destination deessejs
deessejs block publish --slug auth --destination acme
deessejs template releases
deessejs template releases starter --organization acme --verbose
deessejs template releases --verbose --jsontemplate publish and block publish read the stable version from the local descriptor and publish that exact version. Use the separate version bump command when available from PR #577 before publishing a higher release. template releases lists ready releases; add --organization <slug> to query private organization releases you can access. Errors produce a JSON error object and a nonzero process exit code in JSON mode.
organization template request-listing <organization> <template> requests review for the public catalog. It is a separate operation from managed release publishing and approval. It emits JSON by default; add --verbose for a human confirmation. --json overrides --verbose.
deessejs organization template request-listing acme starter --confirm-distribution-rights
deessejs organization template request-listing acme starter --confirm-distribution-rights --verbose
deessejs organization template request-listing acme starter --confirm-distribution-rights --verbose --jsondeessejs add <block-source>
Add a block to a declared project package. The command emits a JSON result by default. Use --verbose to display the planned file changes and human-readable progress. --json overrides --verbose.
deessejs add auth --target api --dry-run
deessejs add auth --target api --organization acme --dry-run --verbose
deessejs add auth --target api --organization acme --yesBefore writing files, add asks for confirmation in an interactive terminal. In a noninteractive environment, writes are refused unless --yes is supplied. --yes is explicit consent to apply the plan without a prompt. A dry run never writes files. Prompts and plan notices go to stderr in JSON mode; JSON result/error data stays on stdout. A failed command exits nonzero.
The block command group has separate info and check commands for inspecting block manifests and validating their source files.
deessejs auth
Subcommand group for the device-flow sign-in. See CLI: Authentication for the full walkthrough including troubleshooting.
deessejs auth login
Browser-based device-flow sign-in. Writes ~/.deessejs/auth.json on success.
deessejs auth login| Flag | Effect |
|---|---|
--json | Emit { ok: true, user } on success. A handled CliError uses { ok: false, code, message }. |
Exit code 0 signals success. Exit code 1 signals failure. Denying the request produces cli_device_denied. An expired, rejected, or unusable device flow produces cli_device_expired. Unexpected failures use the CLI's general error handler.
deessejs auth status
This diagnostic leaves the stored bearer unchanged. It checks the token with the server and prints one of three states: no session, valid session, or stale session. Each state returns 0. Request or server failures return 1.
deessejs auth status| Flag | Effect |
|---|---|
--json | Emit { ok: true, user, fetchedAt }, { ok: false, reason: "no_session" }, or { ok: false, reason: "session_invalid", stored } for the three normal states. A request failure exits nonzero. |
deessejs auth logout
Attempt to invalidate the server-side session, then delete the local token file. A non-2xx response still clears the local file. The CLI logs a warning in human-readable mode. A network failure also clears the local file and returns an error.
deessejs auth logout| Flag | Effect |
|---|---|
--json | Emit { ok: true } on success or when no session exists. A non-2xx sign-out response still counts as local sign-out success. |
Exit code 0 means local sign-out finished, even if the server returned non-2xx. Exit code 1 means the request failed at the transport level. The CLI removes the local token in both cases.
deessejs organization
Organization commands require a session created with deessejs auth login.
deessejs organization list
deessejs organization use acme
deessejs organization current
deessejs organization info acme
deessejs organization create "Acme Studio"| Command | Effect |
|---|---|
organization list | List memberships and mark the organization selected on the server session. |
organization use <slug> | Select one of your organizations for the current server session. |
organization current | Show the active organization, or report an unset or stale selection. |
organization info <slug> | Show an organization the signed-in user belongs to. |
organization create <name> | Create an organization through the authenticated provisioning API. |
These commands emit JSON by default. Use --verbose for human-readable output. If you pass both flags, --json keeps the JSON response. See the CLI package reference for details.
organization list --json returns { organizations, activeOrganizationStatus }. Each organization has an active boolean. activeOrganizationStatus reports active, unset, or stale. organization current --json returns { status: "active", organization }, { status: "unset" }, or { status: "stale" }. After server confirmation, organization use <slug> --json returns { status: "active", organization }. Unknown slugs and organizations outside your memberships share one error message.
Better Auth stores the active organization on the CLI's server session. The CLI doesn't save another selection in auth.json. Selecting an organization doesn't assign or consume a Pro seat. The server checks Pro entitlement and seat assignment for protected managed releases.
Error codes reference
Use these public error codes in scripts. The CLI may include some internal errors in JSON output. Those internal codes can change between releases.
| Code | Meaning | Remediation |
|---|---|---|
not_found | Identifier not found | Check spelling or run deessejs list |
network_error | Network request failed | Check connectivity, then retry |
parse_error | Server response didn't match the v1 contract | This may signal a server-side regression. Open an issue. |
cli_device_denied | You denied the device-flow request in the browser | Re-run deessejs auth login and select Approve |
cli_device_expired | The 30-minute device-code window elapsed | Re-run deessejs auth login |
Internal codes (template_invalid, invalid_target, target_exists, target_not_empty, block_invalid, materialize_failed, install_failed, internal) may also appear under code when you pass --json. They may change without notice.
Most command-specific JSON errors include a hint. Auth commands use the shapes described in the authentication section. Unexpected failures go through the general human-readable error handler.
When list or catalog-based init fetches the registry, the CLI compares the installed version with the server's lowest supported version. A lower version triggers an upgrade warning on the standard error stream, then the command continues. This best-effort check never fails the command.
Global flags
The CLI has no global --api-url flag. By default, it uses https://app.deessejs.com/api/v1 as the API base URL. Set DEESSEJS_API_URL to use another host.