@wordbricks/velen
v0.2.29
Published
Velen CLI
Readme
velen
Rust CLI workspace for velen and the companion CLI API contract.
Key references:
- Human-oriented protocol and workflow spec:
docs/SPEC.md - Split OpenAPI source:
../../packages/cli-contract/openapi/source/cli.openapi.yaml - Generated JSON API contract:
../../packages/cli-contract/openapi/generated/cli.openapi.json
Runtime config:
- On Unix-like systems, the user config file is
${XDG_CONFIG_HOME:-~/.config}/velen/config.toml. - On Windows, the user config file is
%APPDATA%\\velen\\config.toml. - Named profiles use
${XDG_CONFIG_HOME:-~/.config}/velen/profiles/<profile>/config.tomlon Unix-like systems and%APPDATA%\\velen\\profiles\\<profile>\\config.tomlon Windows. - Select a profile with
--profile <profile>,VELEN_PROFILE, or the persisted default fromvelen profile switch <profile>;--profiletakes precedence overVELEN_PROFILE, which takes precedence over the persisted default. The default profile keeps using the legacy flat paths above. - List local profiles with
velen profile list. - The current persisted keys are
active_organdrequest_timeout_sec; the built-in request timeout defaults to 180 seconds. - Runtime config is resolved in this order: built-in defaults -> user config file -> internal typed runtime overrides.
velen org use <org>persistsactive_org. Passing--org <org>for a command takes precedence over the storedactive_orgvalue for that invocation.- The CLI generates an invocation-scoped request ID when
--request-idis not provided, attaches it to outbound HTTP requests, and can report it on transport errors even when no response body is received. - Prefer the built-in request timeout for normal commands. Use
--timeout <sec>only when an invocation intentionally needs a shorter or longer request window. velen auth logoutclears both the stored auth session and the storedactive_orgfor the selected profile, so later org-scoped commands fail explicitly until a new org is selected.
Credential storage:
- On Unix-like systems, the CLI persists the full auth session blob to
${XDG_CONFIG_HOME:-~/.config}/velen/auth.json. - On Windows, the CLI persists the full auth session blob to
%APPDATA%\\velen\\auth.json. - Named profiles use
${XDG_CONFIG_HOME:-~/.config}/velen/profiles/<profile>/auth.jsonon Unix-like systems and%APPDATA%\\velen\\profiles\\<profile>\\auth.jsonon Windows. auth.jsonstores the user identity, bearer token, session timing metadata, and the last refresh timestamp.- Authenticated commands now run an explicit auth-session lifecycle before building an authenticated API client:
load
auth.jsonon startup -> call the CLI session refresh contract -> persist the returned token and timing metadata. VELEN_ACCESS_TOKENremains invocation-only and takes precedence over the selected profile's stored auth session without implicitly writing to it.
Version cache:
- Release builds refresh
${XDG_CONFIG_HOME:-~/.config}/velen/version.jsonon Unix-like systems and%APPDATA%\\velen\\version.jsonon Windows as a cached latest-version record sourced from the npm dist-tags for@wordbricks/velen. - The cache format mirrors Codex:
latest_version,last_checked_at, anddismissed_version.
Install:
bun install -g @wordbricks/velenbunx @wordbricks/velen --helpnpx @wordbricks/velen --helpvelen updateupdates the globally installed Velen binary and Velen CLI agent skill.velen skill addinstalls or updates the Velen CLI agent skill globally.- Linux npm installs ship musl-linked binaries so the CLI runs on both glibc and musl-based distributions, including Alpine.
- Windows npm installs ship both x64 and arm64 platform binaries.
Release:
- Keep
apps/cli/package.jsonat0.0.0-dev. - Keep
apps/cli/Cargo.tomlandapps/cli/Cargo.lockat0.0.0on normal development commits. - Only temporary
release/...branches should changeapps/cli/Cargo.tomlandapps/cli/Cargo.lockto the real release version before tagging. - After the release is tagged, close or delete that temporary release branch/PR so
origin/mainstays at0.0.0. - Configure npm trusted publishing for
@wordbricks/velenwith GitHub Actions using the workflow filenamecli-release.yml. - Push a tag like
cli-v0.1.0orcli-v0.1.0-alpha.1. - The
cli-releaseworkflow validatescli-v<version>againstapps/cli/Cargo.toml, builds GNU and musl Linux binaries plus the other platform binaries, stages npm tarballs, creates a GitHub release, and publishes them to npm withnpm publish --provenance. - Linux npm platform tarballs are staged from musl artifacts for the broadest runtime compatibility.
