@cimi-cms/cli
v0.1.0-beta.0
Published
CIMI command-line tools: schema pull/diff/push and TypeScript type generation.
Maintainers
Readme
@cimi-cms/cli
Command-line tools for CIMI: schema pull/diff/push and TypeScript
type generation. Pairs with @cimi-cms/schema
(definitions + inference) and @cimi-cms/sdk
(typed content client).
npm i -D @cimi-cms/cliSetup
// cimi.config.ts — the token is NEVER stored here
import { defineConfig } from '@cimi-cms/cli';
export default defineConfig({
appId: process.env.CIMI_APP_ID!,
apiUrl: 'https://cimi.co.nl/api/v1',
schema: './cimi/schema/index.ts', // presence ⇒ managed mode; omit for typegen-only
output: './src/cimi/cimi.generated.ts',
});export CIMI_API_TOKEN=cimi_… # scope `read` for types/pull, `read`+`manage` for pushCommands
| Command | What it does |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| cimi init [--force] | Bootstrap defineBlock/defineSection/defineContentType modules from the live app into cimi/schema/ |
| cimi pull | Write the live schema to cimi.schema.json (PR-diffable snapshot) |
| cimi diff | Local definitions vs the live app |
| cimi push [--dry-run] [--prune] [--yes] | Apply local definitions; deletes only with --prune; the server recomputes the diff and refuses stale pushes (409) |
| cimi types [--check] [--watch] | Generate cimi.generated.ts — from local definitions when managed, from the live schema otherwise |
| cimi check | types --check — the CI entry, exit 1 on drift |
Managed mode in one minute
npx cimi init # pull the current model into code
npx cimi diff # should print "No changes"
npx cimi push # the app is now managed: the admin block builder turns read-onlyRenames are explicit: add renamedFrom: 'old-key' to the renamed definition and push —
stored content migrates with the key. Never guessed from similarity.
Full model: docs/SCHEMA_AS_CODE.md in the CIMI repository.
MIT © Wouters Media
