@credibledata/cred-cli
v0.0.104
Published
A cli for Credible's package management.
Keywords
Readme
Cred CLI
Overview
This directory contains a simple CLI to create, update, delete, and list projects, packages, and versions in the Credible's Semantic Model Service.
Usage
For complete usage instructions and command reference, see the official documentation at https://www.credibledata.com/docs/platform-admin/cli.
Driving cred from an agent
cred is built to be run by a coding agent (Claude Code, Codex, Cursor) as well
as by a person. The contract:
- Every question has a flag. A picker is the human way to answer it; the
flag is the other way —
cred login <organization>answers the organization picker,cred publish --yesanswers the publish confirmation, andcred init -o <org> -e <env> [--create-environment] [--connections all|none|a,b] [--skills replace|keep|none] [--package <dir>] --no-start --no-openruns the whole setup with no prompt. - Without a terminal, nothing prompts. When stdin is not a TTY,
CIorCRED_NON_INTERACTIVEis set (to anything but0orfalse), or--non-interactiveis passed, a command that needs an answer exits 2 and prints the flag and the options on stderr, e.g.Cannot ask "Which environment?" without a terminal. Pass --environment <name>. Options: prod-bars, staging.Exit 0 is success, 1 is failure, 2 is "needs input". - Logs go to stderr; data goes to stdout.
cred status --jsonandcred ls ...print one JSON document you can parse.cred status --jsonreportsorganizationandenvironment(whatcred publishhere would act on:--cell's cell, else the directory's pin, else~/.cred),deployment,controlPlane,deploymentFrom(flagwhen--cellchose the deployment,folderwhen this directory's pin did, elseglobal),ignoredPin(the pin's cell, only when--cellnames another),token(valid,kind,expiresInSeconds), and in a directorycred initwired,directory(the pin, with itsdeployment) andpublisher(running,ready,packages,uiUrl,mcpUrl) — or{ "error": ... }with exit 1 when it cannot read your setup. - Every command says where it acts, and acts where the directory is pinned.
In a directory
cred initset up, org- and environment-scoped commands (ls,get,add,update,rm,publish) use the directory's deployment, organization and environment; elsewhere,~/.cred's. Each printsUsing <org>/<env> on <deployment>, pinned in .credible/config.json.(orfrom your global settings) on stderr, and every confirmation repeats it. An agent should check that line before anything that changes state.cred set environmentalways changes the global setting;cred dev -ere-pins a directory.--cellnaming another cell than the pin makes reads act on that cell, and makes writes (publish,add connection) andcred devrefuse;cred --cell <cell> initis the explicit re-pin. cred publishcan be previewed and read back.--dry-runlists the files it would upload (stdout) and the ones it leaves out (stderr), uploads nothing and needs no login.--jsonprints one document:organization,environment,package,version,url(the version in the app),latest(now,when-builtorno),latestVersion,excludedandresponse(the server's reply as sent). With--dry-run,--jsonprintsdryRun(true),package,version,includedandexcludedinstead. A.credignorebesidepublisher.jsonleaves more files out, one path or glob per line (notes.md,tests/,/docs), matched regardless of case (secrets/also leaves outSecrets/). A nested.credignoreis not read, and every file or folder named.credignore, at any depth, is always left out of the upload. It can never put back a file the fixed list leaves out, and a publish stops if it leaves outpublisher.json. Warnings the server raises on the publish print on stderr after the link; with--jsonthey are only inresponse.warnings.cred get version <package> <version>shows whether a version has built (buildStatus) and is waiting to become latest (promoteWhenReady);cred get package <package>shows the latest.cred tokenprints a usable access token and nothing else, renewing it first when it is within two minutes of expiring. It exits 1 rather than print a token that has already expired.cred loginneeds the human once. It prints a URL and a code; relay them and wait — it polls until they sign in.cred devis a foreground process. Start it in the background with--no-open, then pollcred status --jsonuntilpublisher.readyis true (runningalone can be a server whose only package failed to compile).
The three journeys, as commands:
# 1. I run a local Publisher against my own warehouse; move to Credible.
cred init -e my-env --create-environment --connections my_warehouse --no-start
cred dev --no-open & # then poll: cred status --json
cred publish -y # publisher.config.json is never uploaded
# 2. I run a local Publisher over CSV / DuckDB files; publish the package.
# (a create-malloy-package directory: setup serves the package it lists,
# and --skills says what to do with the scaffolder's skills)
cred init -e my-env --create-environment --connections none --skills replace --no-start
cd shop && cred publish -y # the data files travel inside the package
# 3. I use Credible and want to model locally with Claude Code.
cred init -e prod-bars --no-start # skills, .mcp.json, CLAUDE.md, publisher config
cred dev --no-open & # local publisher proxies to the real warehouse