@estokad/cli
v0.1.6
Published
Customer-side CLI: estokad push, pull, diff, init, status.
Downloads
76
Readme
@estokad/cli
The customer-side CLI. Loads schemas/*.ts, compiles to JSON IR via @estokad/schema, and pushes to the management API.
Status
M1.2: init, push, status shipped. pull and diff land in M1.2b once the Library and editor surfaces are in.
Install (in a customer repo)
pnpm add -D @estokad/cli @estokad/schema
pnpm estokad init # scaffolds estokad.config.ts and schemas/estokad init writes:
estokad.config.ts # workspace, region, apiUrl, paths
schemas/index.ts # re-export entry point
schemas/site-settings.ts # tiny singleton, smoke test the loop
.estokad/.gitignoreConfigure
Three sources, highest precedence first: CLI flags → env vars → estokad.config.ts.
| Setting | Env var | Default |
| --------- | ------------------- | -------------------------------- |
| workspace | ESTOKAD_WORKSPACE | (required) |
| apiUrl | ESTOKAD_API_URL | (required) |
| apiKey | ESTOKAD_API_KEY | (required, never in config file) |
| region | ESTOKAD_REGION | eu-fra-1 |
| schemas | — | ./schemas |
| state | — | ./.estokad/schema-state.json |
The state file maps type/field names to UUIDs across runs so renames stay stable in the IR. Commit it so your team shares identity.
Commands
estokad init
Scaffolds the customer repo. --force overwrites existing files.
estokad push
$ estokad push
workspace default @ http://localhost:3001
✓ loaded 12 definitions from ./schemas
✓ compiled to JSON IR (12 types)
✓ pushed to default@eu-fra-1 (12 types)
✓ state saved to ./.estokad/schema-state.jsonExit codes: 0 success · 2 config or schema-load error · 3 API rejected the push.
estokad status
$ estokad status
estokad status
workspace default @ http://localhost:3001
region eu-fra-1
local 12 types · 7c8b...
remote 12 types · 7c8b...
drift in syncLocal hash is a stable hash of the compiled IR. Remote hash is the join of every type's schema_hash from the API.
What this package does not do
- File watching / hot reload — run
estokad pushexplicitly. --migrateprompts for breaking changes — M1.3 (server-side validation against existing entries) gates this.- Studio writeback to Git — Phase 2+ (the Studio's job, not the CLI's).
Documentation
Full reference at docs.estokad.com/cli and docs.estokad.com/schema.
License
Apache-2.0. Estokad is a Samarkand Industries OÜ product.
