cgenius CLI

The command-line tool for people, CI and agents.

Status: not released. The cgenius command-line tool (npm package @cgenius/cli) is being built. This page describes its planned design; details can change before release. Every command maps to one API Operation (the table below comes from the Capability Catalog), so anything the CLI will do already works over HTTP (Recipes).

Install (when released)

npm install -g @cgenius/cli      # Node 20 or later
cgenius --version

Sign in

cgenius auth login                          # opens the approve page and shows a code to compare
cgenius auth login --scopes content:read,content:write,jobs:read,jobs:write --no-ai --expires 90d --name ci
echo "$CG_TOKEN" | cgenius auth login --with-token   # use an existing token (read from stdin)
cgenius auth status                         # GET /api/v1/me; prints the token as cg_xxxxxxxx…
cgenius auth logout                         # revokes the token (DELETE /api/v1/tokens/{id}) and removes it locally

auth login uses the CLI login flow. The token is kept in $XDG_CONFIG_HOME/cgenius/config.json (else ~/.config/cgenius/config.json; on Windows %APPDATA%\cgenius\config.json), written with mode 600, as { currentProfile, profiles: { name: { apiUrl, token, workspace? } } }. Precedence: flag, then environment (CGENIUS_API_TOKEN, CGENIUS_API_URL), then profile, then the default https://app.cgenius.app.

Behaviour

  • Every request sends a new X-Request-Id and User-Agent: cgenius-cli/<version>; create and start requests send an Idempotency-Key, reused on retry.
  • Network errors, 429 and 5xx are retried up to 3 times (1, 2, 4 s with jitter, or Retry-After).
  • Commands that start a Job wait by default, following POST /api/v1/jobs/{id}/advance as a stream; --stream prints the text as it is written, progress goes to stderr. --no-wait prints {jobId} and exits; --timeout (default 30 min) exits with code 1 and the Job id for cgenius job wait.
  • --output <path> downloads file results (PDF, PPTX, image, video) after completion.
  • --json prints exactly one JSON document on stdout (the API answer), for scripts and agents.
  • Errors go to stderr as error: <message> (code <code>, request <correlationId>).
  • Once a day the CLI compares its version with info.version of the API and prints an upgrade notice when the API is newer.
Exit codeMeaning
0ok
1API or Job error
2usage error
3unauthenticated, insufficient_scope or ai_access_unavailable
4not_found
5rate_limited after retries
6network_rules_violation

Global options

OptionMeaning
--profile <name>Use another profile
--api-url <url>Another server
--workspace <id>Sent as X-Workspace-Id
--jsonMachine-readable output

Commands

CommandOperationState
cgenius articles listblogArticles.listplanned
cgenius assistants listassistants.listAPI ready
cgenius audit listauditEvents.listAPI ready
cgenius auth loginauth.cliSessions.createAPI ready
cgenius auth loginauth.cliSessions.exchangeAPI ready
cgenius billing buybilling.checkoutAPI ready
cgenius billing portalbilling.portalAPI ready
cgenius billing statusbilling.getAPI ready
cgenius blog createblogs.v3.createAPI ready
cgenius blog createblogs.v2.createAPI ready
cgenius blog createblogs.v1.createAPI ready
cgenius blog deleteblogs.v3.deleteplanned
cgenius blog getblogs.v3.getAPI ready
cgenius blog getblogs.v2.getAPI ready
cgenius blog getblogs.v1.getAPI ready
cgenius blog listblogs.v3.listplanned
cgenius blog listblogs.v2.listplanned
cgenius blog regenerate-sectionblogs.v3.regenerateSectionAPI ready
cgenius blog regenerate-sectionblogs.v2.regenerateSectionplanned
cgenius blog researchgenerate.researchBlogplanned
cgenius blog resumeblogs.v3.resumeAPI ready
cgenius blog resumeblogs.v2.resumeAPI ready
cgenius blog updateblogs.v3.updateContentplanned
cgenius brand-voice createbrandVoices.createplanned
cgenius brand-voice deletebrandVoices.deleteplanned
cgenius brand-voice getbrandVoices.getplanned
cgenius brand-voice listbrandVoices.listplanned
cgenius brand-voice updatebrandVoices.updateplanned
cgenius brief createcustomerBriefs.createplanned
cgenius brief listcustomerBriefs.listplanned
cgenius buffer channelsconnections.buffer.channelsAPI ready
cgenius buffer connectconnections.buffer.connectAPI ready
cgenius buffer disconnectconnections.buffer.disconnectAPI ready
cgenius buffer sendpublish.bufferAPI ready
cgenius buffer statusconnections.buffer.getAPI ready
cgenius chat sendchat.sendplanned
cgenius connections addconnections.startplanned
cgenius connections getconnections.getplanned
cgenius connections listconnections.listplanned
cgenius connections removeconnections.deleteplanned
cgenius connections targetsconnections.targetsplanned
cgenius content deletecontentItems.deleteplanned
cgenius content exportcontentItems.exportplanned
cgenius content getcontentItems.getAPI ready
cgenius content listcontentItems.listAPI ready
cgenius content pdfcontentItems.pdfplanned
cgenius content sendcontentItems.sendAPI ready
cgenius content updatecontentItems.updateplanned
cgenius dashboarddashboard.getplanned
cgenius document creategenerate.documentplanned
cgenius email creategenerate.emailAPI ready
cgenius endpoints addintegrationEndpoints.createplanned
cgenius endpoints listintegrationEndpoints.listAPI ready
cgenius endpoints removeintegrationEndpoints.deleteplanned
cgenius endpoints testintegrationEndpoints.testplanned
cgenius endpoints updateintegrationEndpoints.updateplanned
cgenius ideas analyzeideation.analyzeAPI ready
cgenius ideas createideation.ideas.createplanned
cgenius ideas deleteideation.ideas.deleteplanned
cgenius ideas from-leadsideation.leadIdeas.createAPI ready
cgenius ideas generateideation.ideas.generateplanned
cgenius ideas getideation.ideas.getplanned
cgenius ideas listideation.ideas.listplanned
cgenius ideas updateideation.ideas.updateplanned
cgenius image creategenerate.imageplanned
cgenius job canceljobs.cancelAPI ready
cgenius job listjobs.listAPI ready
cgenius job resumejobs.resumeAPI ready
cgenius job statusjobs.getAPI ready
cgenius job waitjobs.advanceAPI ready
cgenius knowledge uploadknowledge.uploadplanned
cgenius lead-app companiesleadApp.companies.listAPI ready
cgenius lead-app leadsleadApp.leads.listplanned
cgenius lead-app listleadApp.entities.listplanned
cgenius maintenance create-bugmaintenance.tickets.createplanned
cgenius maintenance deletemaintenance.tickets.deleteplanned
cgenius maintenance getmaintenance.tickets.getplanned
cgenius maintenance listmaintenance.tickets.listplanned
cgenius maintenance updatemaintenance.tickets.updateplanned
cgenius meme.getAPI ready
cgenius media deletemedia.deleteplanned
cgenius media getmedia.images.getAPI ready
cgenius media importmedia.importplanned
cgenius media import-generatedmedia.generatedImages.importAPI ready
cgenius media listmedia.listplanned
cgenius media updatemedia.updateplanned
cgenius media uploadmedia.uploadplanned
cgenius newsletter listnewsletterFeeds.listplanned
cgenius offer creategenerate.offerAPI ready
cgenius offer deleteoffers.deleteplanned
cgenius offer getoffers.getplanned
cgenius offer listoffers.listplanned
cgenius offer researchofferResearch.createplanned
cgenius onboarding setuponboarding.setupplanned
cgenius presentation creategenerate.presentationAPI ready
cgenius presentation listpresentations.listplanned
cgenius projects createprojects.createplanned
cgenius projects listprojects.listAPI ready
cgenius projects useprojects.activateplanned
cgenius proposal creategenerate.proposalplanned
cgenius proposal listproposals.listplanned
cgenius proposal updateproposals.updateplanned
cgenius publications listpublications.listplanned
cgenius publish nowpublish.startplanned
cgenius publish previewpublish.previewplanned
cgenius questionnaire cancelquestionnaires.cancelplanned
cgenius questionnaire createquestionnaires.createplanned
cgenius questionnaire listquestionnaires.listplanned
cgenius questionnaire statusquestionnaires.getplanned
cgenius research creategenerate.researchAPI ready
cgenius schedule cancelschedules.deleteplanned
cgenius schedule createschedules.createplanned
cgenius schedule getschedules.getplanned
cgenius schedule listschedules.listplanned
cgenius schedule updateschedules.updateplanned
cgenius settings getsettings.getAPI ready
cgenius settings setsettings.updateAPI ready
cgenius settings unsetsettings.deleteAPI ready
cgenius social channelssocial.channels.listAPI ready
cgenius social creategenerate.socialPostAPI ready
cgenius social fitsocial.fitAPI ready
cgenius token ai-access removetokens.removeAiAccessAPI ready
cgenius token createtokens.createAPI ready
cgenius token gettokens.getAPI ready
cgenius token listtokens.listAPI ready
cgenius token renametokens.updateAPI ready
cgenius token revoketokens.deleteAPI ready
cgenius video adgenerate.videoAdAPI ready
cgenius video ad getgenerate.videoAd.getAPI ready
cgenius video listvideos.listplanned
cgenius video rendergenerate.videoplanned

Use from an agent

Prefer --json and read .job.status / .error.code rather than the human output. Until the CLI ships, call the API directly: each row above names the Operation to use (see the reference).