{"id":48363489,"url":"https://github.com/cosmicjs/cli","last_synced_at":"2026-04-05T13:31:15.078Z","repository":{"id":337499467,"uuid":"1144052860","full_name":"cosmicjs/cli","owner":"cosmicjs","description":"AI-powered CLI for Cosmic - manage content, media, deployments, and AI agents through natural language and direct commands","archived":false,"fork":false,"pushed_at":"2026-03-30T18:12:09.000Z","size":497,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T20:05:05.256Z","etag":null,"topics":["ai","cli","cms","content-management","cosmic","developer-tools","headless-cms"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@cosmicjs/cli","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosmicjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-28T08:29:40.000Z","updated_at":"2026-03-30T18:07:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d5a1bd3-674e-4227-91f0-0cf6d0eb4f3a","html_url":"https://github.com/cosmicjs/cli","commit_stats":null,"previous_names":["cosmicjs/cli"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/cosmicjs/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmicjs","download_url":"https://codeload.github.com/cosmicjs/cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31437927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T13:13:19.330Z","status":"ssl_error","status_checked_at":"2026-04-05T13:13:17.778Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","cli","cms","content-management","cosmic","developer-tools","headless-cms"],"created_at":"2026-04-05T13:31:13.551Z","updated_at":"2026-04-05T13:31:15.071Z","avatar_url":"https://github.com/cosmicjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cosmic CLI\n\n[![npm version](https://img.shields.io/npm/v/@cosmicjs/cli.svg)](https://www.npmjs.com/package/@cosmicjs/cli)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nAI-powered command-line interface for [Cosmic](https://www.cosmicjs.com). Manage your content, media, repositories, deployments, workflows, and AI agents through natural language and direct commands.\n\n![Cosmic CLI](https://imgix.cosmicjs.com/c3568730-05ea-11f1-bc2b-43ecd007e1aa-cosmic-cli-screenshot-1.png?w=2000\u0026auto=format,compression)\n\n## Zero to Production in One Command\n\n```bash\ncosmic login \u0026\u0026 cosmic projects create \u0026\u0026 cosmic build -p \"A recipe blog\" \u0026\u0026 cosmic deploy start --watch\n# → Creates project, generates content model, builds Next.js app, deploys to Vercel\n```\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Authentication](#authentication)\n- [Interactive Shell](#interactive-shell)\n- [Core Commands](#core-commands)\n  - [Context \u0026 Navigation](#context--navigation)\n  - [Objects](#objects)\n  - [Types](#types)\n  - [Media](#media)\n  - [Media Folders](#media-folders)\n  - [Billing](#billing)\n  - [Repositories](#repositories)\n  - [Deployments](#deployments)\n  - [Webhooks](#webhooks)\n  - [Team](#team)\n  - [Domains](#domains)\n  - [Workflows](#workflows)\n  - [Agents](#agents)\n  - [AI Generation](#ai-generation)\n- [Shortcut Commands](#shortcut-commands)\n  - [Content Mode](#content-mode)\n  - [Build Mode](#build-mode)\n  - [Update Mode](#update-mode)\n  - [Automate Mode](#automate-mode)\n- [Interactive Chat Mode](#interactive-chat-mode)\n- [Configuration](#configuration)\n- [AI Models](#ai-models)\n- [Examples](#examples)\n- [Testing](#testing)\n- [Support](#support)\n\n## Features\n\n- **Interactive Shell** - Run commands without the `cosmic` prefix\n- **AI-Powered Chat Mode** - Interact with your content using natural language\n- **Shortcut Commands** - `content`, `build`, `update`, and `automate` for common AI workflows\n- **Direct Commands** - Full CRUD for objects, media, types, repos, workflows, and agents\n- **Media Folders** - Create, update, delete folders and move media between them\n- **Billing Management** - View plans, subscribe to addons, check usage, open billing portal\n- **Team Management** - Add, update, and remove project team members\n- **Webhooks** - Create and manage webhooks for content events\n- **Domains \u0026 DNS** - Import domains, manage DNS records, connect to deployments\n- **Repository \u0026 Deploy** - Connect GitHub repos and deploy to Vercel\n- **Multiple Auth Methods** - User login, Personal Access Tokens, or bucket keys\n- **Context Management** - Navigate workspaces, projects, and buckets like a filesystem\n- **AI Generation** - Generate text, images, and audio with streaming output\n- **AI Agents** - Content, repository, and computer use agents with scheduling\n- **AI Automation** - Create agents and workflows with natural language\n- **Auth Capture** - Capture browser auth locally for computer use agents\n\n\u003e **Full Reference:** See [docs/CLI_REFERENCE.md](docs/CLI_REFERENCE.md) for complete command documentation.\n\n## Installation\n\n```bash\n# Install globally with npm\nnpm install -g @cosmicjs/cli\n\n# Or with bun\nbun add -g @cosmicjs/cli\n```\n\n## Quick Start\n\n```bash\n# Login to your Cosmic account\ncosmic login\n\n# Set your working context (interactive selection)\ncosmic use\n\n# Start interactive shell (no \"cosmic\" prefix needed)\ncosmic shell\n\n# Or run individual commands\ncosmic chat                 # Start AI chat mode\ncosmic content              # Create/manage content with AI\ncosmic build                # Build a new app with AI\ncosmic update my-repo       # Update existing code with AI\ncosmic automate             # Create agents \u0026 workflows with AI\n```\n\n## Authentication\n\n### User Authentication\n\nLogin with your Cosmic account for full dashboard access:\n\n```bash\ncosmic login\ncosmic whoami               # Show current user\ncosmic logout               # Clear credentials\n```\n\n### Personal Access Token\n\nAuthenticate with a [Personal Access Token](https://app.cosmicjs.com/account/api-tokens) for scripts, CI/CD, and automation:\n\n```bash\n# Login with a token\ncosmic login --token cos_YOUR_TOKEN\n\n# Or set the COSMIC_TOKEN environment variable\nexport COSMIC_TOKEN=cos_YOUR_TOKEN\ncosmic whoami\n```\n\nCreate tokens at [Account Settings \u003e API Tokens](https://app.cosmicjs.com/account/api-tokens). The `COSMIC_TOKEN` env var takes priority over stored credentials, making it ideal for CI/CD pipelines.\n\n### Bucket Key Authentication\n\nFor quick bucket-level access without logging in:\n\n```bash\ncosmic use --bucket=my-bucket --read-key=your-read-key --write-key=your-write-key\n```\n\n## Interactive Shell\n\nStart an interactive shell where you can run commands without typing `cosmic` each time:\n\n```bash\ncosmic shell\n\n  Cosmic Shell v1.0.0\n  Logged in as: you@example.com\n\ncosmic default\u003e ls\ncosmic default\u003e cd my-project\ncosmic my-project\u003e objects list\ncosmic my-project\u003e !git status    # Use ! prefix for system commands\ncosmic my-project\u003e exit\n```\n\n### Shell Features\n\n- No `cosmic` prefix needed for commands\n- `!` prefix runs system shell commands (`!ls`, `!git status`)\n- Prompt shows current workspace/bucket context\n- Command history with arrow keys\n- `help` shows available commands\n- `exit` or `quit` to leave\n\n**Alias:** `cosmic sh`\n\n## Core Commands\n\n### Context \u0026 Navigation\n\n```bash\n# Set working context\ncosmic use                          # Interactive workspace selection\ncosmic use my-workspace             # Switch to a workspace\ncosmic use -                        # Switch to default projects (no workspace)\ncosmic context                      # Show current context\n\n# Navigate like a filesystem\ncosmic ls                           # List contents at current level\ncosmic cd my-project                # Navigate into project\ncosmic cd my-bucket                 # Navigate into bucket\ncosmic cd posts                     # Navigate into object type\ncosmic cd ..                        # Go up one level\ncosmic pwd                          # Show current location\n```\n\n### Objects\n\n```bash\ncosmic objects list                          # List objects\ncosmic objects list --type=posts             # Filter by type\ncosmic objects list --status=draft           # Filter by status\ncosmic objects list --props \"id,title,metadata\"  # Select specific fields\ncosmic objects get \u003cid\u003e                      # Get object details\ncosmic objects get \u003cid\u003e --depth 2            # With nested references\ncosmic objects create --type=posts           # Create object (interactive)\ncosmic objects update \u003cid\u003e --title=\"New\"     # Update object\ncosmic objects delete \u003cid\u003e                   # Delete object\ncosmic objects publish \u003cid\u003e                  # Publish object\ncosmic objects types                         # List object types\n```\n\n### Types\n\n```bash\ncosmic types list                           # List object types\ncosmic types get \u003cslug\u003e                     # Get type details \u0026 metafields\ncosmic types create --title \"Posts\"         # Create object type (interactive)\ncosmic types update \u003cslug\u003e --emoji \"📝\"     # Update object type\ncosmic types delete \u003cslug\u003e                  # Delete type (and all its objects)\ncosmic types duplicate \u003cslug\u003e              # Duplicate a type\n```\n\n### Media\n\n```bash\ncosmic media list                    # List media files\ncosmic media list --folder=images    # Filter by folder\ncosmic media get \u003cid\u003e                # Get media details\ncosmic media upload ./image.png      # Upload file\ncosmic media delete \u003cid\u003e             # Delete media\ncosmic media move \u003cid\u003e --folder=photos  # Move media to a folder\ncosmic media unfolder \u003cid\u003e           # Remove media from folder\n```\n\n### Media Folders\n\n```bash\ncosmic media folders list                     # List all media folders\ncosmic media folders create --title \"Photos\"  # Create folder\ncosmic media folders update \u003cslug\u003e --title \"Images\"  # Update folder\ncosmic media folders delete \u003cslug\u003e            # Delete folder\n```\n\n### Billing\n\n```bash\ncosmic billing usage                          # Show project usage statistics\ncosmic billing open                           # Open billing page in browser\ncosmic billing portal                         # Open Stripe billing portal in browser\ncosmic billing plans list                     # List available plans with pricing\ncosmic billing plans subscribe                # Subscribe to a plan (interactive, with confirmation)\ncosmic billing plans cancel                   # Cancel plan subscription\ncosmic billing addons list                    # List addons with current quantities\ncosmic billing addons subscribe               # Subscribe/update addons (interactive, with confirmation)\ncosmic billing addons cancel \u003caddonId\u003e        # Cancel addon subscription\n```\n\n\u003e Quantity-based addons (users, buckets, AI tokens) are handled through `addons subscribe` -- it prompts for quantities, defaults to current values, and manages AI input/output tokens together.\n\n### Repositories\n\n```bash\ncosmic repos list                              # List connected repos\ncosmic repos get \u003cid\u003e                          # Get repo details\ncosmic repos connect --url \u003cgithub-url\u003e        # Connect a GitHub repo\ncosmic repos clone                             # Clone repo \u0026 create .env with Cosmic keys\ncosmic repos clone \u003crepoId\u003e                    # Clone specific repo\ncosmic repos clone \u003cgithub-url\u003e                # Clone from URL\ncosmic repos delete \u003cid\u003e                       # Disconnect repo\n\n# Branch management\ncosmic repos branches \u003crepoId\u003e list            # List branches\ncosmic repos branches \u003crepoId\u003e create          # Create branch\ncosmic repos branches \u003crepoId\u003e delete \u003cname\u003e   # Delete branch\n\n# Pull request management\ncosmic repos pr list \u003crepoId\u003e                  # List pull requests\ncosmic repos pr get \u003crepoId\u003e \u003cnumber\u003e          # Get PR details\ncosmic repos pr create \u003crepoId\u003e                # Create pull request\ncosmic repos pr merge \u003crepoId\u003e \u003cnumber\u003e        # Merge pull request\ncosmic repos pr close \u003crepoId\u003e \u003cnumber\u003e        # Close pull request\n\n# Environment variables (Vercel deployment)\ncosmic repos env list \u003crepoId\u003e                 # List env vars\ncosmic repos env create \u003crepoId\u003e -k KEY -v VALUE  # Add env var (alias: add)\ncosmic repos env edit \u003crepoId\u003e KEY -v VALUE    # Edit env var\ncosmic repos env delete \u003crepoId\u003e KEY           # Delete env var\n\n# Custom domains (Vercel deployment)\ncosmic repos domains list \u003crepoId\u003e             # List domains\ncosmic repos domains create \u003crepoId\u003e \u003cdomain\u003e  # Add domain (alias: add)\ncosmic repos domains create \u003crepoId\u003e www.example.com --redirect example.com  # Add with redirect\ncosmic repos domains edit \u003crepoId\u003e \u003cdomain\u003e -r \u003curl\u003e   # Update redirect\ncosmic repos domains delete \u003crepoId\u003e \u003cdomain\u003e  # Remove domain\n```\n\n### Deployments\n\n```bash\ncosmic deploy start \u003crepoId\u003e                   # Deploy to Vercel\ncosmic deploy start \u003crepoId\u003e --watch           # Deploy and watch progress\ncosmic deploy start \u003crepoId\u003e --branch main     # Deploy from specific branch (repos with Vercel project)\ncosmic deploy redeploy \u003crepoId\u003e                # Redeploy with branch selection (interactive)\ncosmic deploy redeploy \u003crepoId\u003e --branch main  # Redeploy from specific branch\ncosmic deploy list \u003crepoId\u003e                    # List deployments\ncosmic deploy logs \u003cdeploymentId\u003e              # Get logs\ncosmic deploy logs \u003cdeploymentId\u003e --follow     # Stream logs\ncosmic deploy cancel \u003crepoId\u003e \u003cdeploymentId\u003e   # Cancel deployment\n```\n\n### Webhooks\n\n```bash\ncosmic webhooks list                                        # List webhooks\ncosmic webhooks get \u003cid\u003e                                    # Get webhook details\ncosmic webhooks create                                      # Create webhook (interactive)\ncosmic webhooks create --title \"Notify\" \\\n  --endpoint https://example.com/hook \\\n  --resource objects --events created,edited               # Create with options\ncosmic webhooks update \u003cid\u003e --endpoint https://new.url     # Update webhook\ncosmic webhooks delete \u003cid\u003e                                # Delete webhook\n```\n\n### Team\n\n```bash\ncosmic team list                              # List project team members\ncosmic team add user@example.com              # Add team member (interactive role)\ncosmic team add user@example.com --role admin # Add with specific role\ncosmic team update \u003cuserId\u003e --role manager    # Change member role\ncosmic team remove \u003cuserId\u003e                   # Remove team member\n```\n\n### Domains\n\n```bash\ncosmic domains list                                  # List all domains\ncosmic domains get \u003cid\u003e                              # Get domain details\ncosmic domains search example.com                    # Search available domains\ncosmic domains import example.com                    # Import external domain\ncosmic domains connect \u003cid\u003e --repo \u003crepoId\u003e          # Connect domain to repo\ncosmic domains disconnect \u003cid\u003e --repo \u003crepoId\u003e       # Disconnect from repo\ncosmic domains delete \u003cid\u003e                           # Delete domain\n\n# DNS record management\ncosmic domains dns list \u003cdomainId\u003e                   # List DNS records\ncosmic domains dns add \u003cdomainId\u003e                    # Add record (interactive)\ncosmic domains dns add \u003cdomainId\u003e -t A -n @ -v 1.2.3.4  # Add with options\ncosmic domains dns update \u003cdomainId\u003e \u003crecordId\u003e      # Update record\ncosmic domains dns delete \u003cdomainId\u003e \u003crecordId\u003e      # Delete record\n```\n\n### Workflows\n\n```bash\ncosmic workflows list                          # List workflows\ncosmic workflows get \u003cid\u003e                      # Get workflow details\ncosmic workflows create --agent \u003cagentId\u003e      # Create with initial agent\ncosmic workflows add-step \u003cid\u003e --agent \u003cid\u003e    # Add agent as step\ncosmic workflows remove-step \u003cid\u003e --step 2     # Remove step\ncosmic workflows run \u003cid\u003e                      # Execute workflow\ncosmic workflows executions                    # List executions\ncosmic workflows executions \u003cexecId\u003e           # Get execution details\ncosmic workflows executions \u003cexecId\u003e --watch   # Watch until complete\ncosmic workflows cancel \u003cexecId\u003e               # Cancel execution\n```\n\n### Agents\n\n```bash\ncosmic agents list                   # List agents\ncosmic agents get \u003cid\u003e               # Get agent details\ncosmic agents create --type=content  # Create agent (interactive)\ncosmic agents run \u003cid\u003e               # Run agent\ncosmic agents executions \u003cagentId\u003e   # List executions\ncosmic agents delete \u003cid\u003e            # Delete agent\n\n# Advanced agent operations\ncosmic agents follow-up \u003cagentId\u003e              # Continue work on same branch\ncosmic agents pr \u003cagentId\u003e                     # Create PR from agent work\ncosmic agents approve \u003cagentId\u003e \u003cexecId\u003e       # Approve pending operations\ncosmic agents capture-auth --url \u003clogin-url\u003e   # Capture browser auth\n```\n\n#### Agent Types\n\n| Type | Alias | Description |\n|------|-------|-------------|\n| `content` | - | Creates and manages content in your bucket |\n| `repository` | `code`, `repo` | Makes code changes to connected repositories |\n| `computer_use` | - | Browser automation with AI vision |\n\n### AI Generation\n\n```bash\ncosmic ai generate \"Your prompt\"               # Generate text (streaming)\ncosmic ai generate \"prompt\" --model=gpt-5      # Specify model\ncosmic ai image \"A sunset over mountains\"      # Generate image\ncosmic ai image \"prompt\" --folder=heroes       # Save to folder\ncosmic ai audio \"Welcome to our podcast\"       # Generate audio (text-to-speech)\ncosmic ai audio \"prompt\" --voice=alloy         # Specify voice\ncosmic ai chat \"Tell me about my content\"      # Single chat message\n```\n\n## Shortcut Commands\n\nThese shortcuts make common AI workflows faster:\n\n### Content Mode\n\nCreate and manage content with AI assistance:\n\n```bash\ncosmic content                                 # Start content chat\ncosmic content -p \"Create 5 blog posts\"        # With initial prompt\ncosmic content --types posts,authors           # Include specific object types\ncosmic content --ask                           # Read-only mode (no changes)\n```\n\n### Build Mode\n\nGenerate complete applications:\n\n```bash\ncosmic build                                   # Start build chat (interactive)\ncosmic build -p \"A blog with dark mode\"        # With description\ncosmic build --types posts                     # Include content as context\ncosmic build --ask                             # Ask questions without generating\n```\n\n### Update Mode\n\nModify existing repository code:\n\n```bash\ncosmic update                                  # Select repo interactively\ncosmic update my-repo                          # Specify repo\ncosmic update my-repo -b feature-branch        # Specify branch\ncosmic update my-repo -p \"Add dark mode\"       # With instructions\ncosmic update --ask                            # Explore code without changes\n```\n\n### Automate Mode\n\nCreate AI agents and workflows with natural language:\n\n```bash\ncosmic automate                                # Start automate chat\ncosmic automate -p \"Create a weekly content agent\"  # With initial prompt\ncosmic automate --ask                          # Ask about automation without creating\n```\n\n## Interactive Chat Mode\n\nStart an interactive AI chat session:\n\n```bash\ncosmic chat                  # Default ask mode (read-only)\ncosmic chat --content        # Content mode (can modify content)\ncosmic chat --build          # Build mode (generate apps)\ncosmic chat --repo           # Repository mode (code changes)\ncosmic chat --automate       # Automation mode (create agents \u0026 workflows)\n```\n\n### Context Options\n\nProvide context to the AI:\n\n```bash\ncosmic chat --types posts,authors              # Include object types\ncosmic chat --links \"https://docs.example.com\" # Include external URLs\ncosmic chat --objects-limit 50                 # Max objects per type\ncosmic chat --objects-depth 2                  # Nested metafield depth\n```\n\n### Chat Commands\n\nInside chat mode:\n- `exit` / `quit` - Exit chat\n- `clear` - Clear conversation history\n- `context` - Show current context\n- `help` - Show available commands\n\n## Configuration\n\n```bash\ncosmic config get                    # Show all config\ncosmic config get defaultModel       # Get specific value\ncosmic config set defaultModel gpt-5 # Set value\n```\n\n### Config Options\n\n| Option | Description |\n|--------|-------------|\n| `defaultModel` | Default AI model for generation |\n| `apiUrl` | Custom API URL |\n| `sdkUrl` | Custom SDK URL (for local development) |\n\nConfiguration stored in `~/.cosmic/`:\n- `config.json` - Settings\n- `credentials.json` - Auth tokens\n\n## AI Models\n\n```bash\ncosmic models                        # List all available models\n```\n\nSet your default model:\n\n```bash\ncosmic config set defaultModel claude-opus-4-5-20251101\n```\n\nOr specify per-command:\n\n```bash\ncosmic ai generate --model=gpt-5 \"Your prompt\"\n```\n\n**Available models:**\n- **Claude (Anthropic):** `claude-sonnet-4-6`, `claude-opus-4-5-20251101`, `claude-sonnet-4-5-20250929`, `claude-haiku-4-5-20251001`\n- **GPT (OpenAI):** `gpt-5`, `gpt-5.2`, `gpt-5-mini`, `gpt-4o`\n- **Gemini (Google):** `gemini-3-pro-preview`\n\n## Examples\n\n### Clone and Develop Locally\n\n```bash\n# Clone a connected repository with auto-configured .env\ncosmic repos clone                             # Interactive selection\ncosmic repos clone \u003crepoId\u003e                    # By repository ID\ncosmic repos clone https://github.com/user/repo  # By URL\n\n# The clone command:\n# - Clones the repo to a local directory\n# - Creates .env with COSMIC_BUCKET_SLUG, COSMIC_READ_KEY, COSMIC_WRITE_KEY\n# - Also adds NEXT_PUBLIC_ variants for Next.js apps\n\n# Start developing immediately\ncd my-repo\nnpm install\nnpm run dev\n```\n\n### Build and Deploy an App (Full Walkthrough)\n\n```bash\n# 1. Login to Cosmic\ncosmic login\n\n# 2. Create a new project with AI-generated content\ncosmic projects create\n# Follow prompts: name your project, choose \"Use AI to generate content model\"\n# Describe: \"A recipe blog with recipes, categories, and authors\"\n\n# 3. Generate more content with AI\ncosmic content -p \"Create 5 recipes with images across different categories\"\n\n# 4. Build an app from your content\ncosmic build -p \"A modern recipe blog with search and category filtering\"\n# AI generates a complete Next.js app and creates a GitHub repo\n\n# 5. Deploy to Vercel\ncosmic repos list                              # Find your repo ID\ncosmic deploy start \u003crepoId\u003e --watch           # Deploy and watch progress\n# ✓ Deployment ready: https://recipe-blog-abc123.vercel.app\n\n# 6. Clone locally for development\ncosmic repos clone \u003crepoName\u003e                  # Clone with .env auto-configured\ncd recipe-blog \u0026\u0026 npm install \u0026\u0026 npm run dev   # Start local dev\n\n# 7. Make updates to the app\ncosmic update -p \"Add a favorites feature and dark mode\" -b theme\n# AI makes changes to the code on branch theme\n\n# 8. Create a PR for the changes\ncosmic repos pr create \u003crepoId\u003e\n# ✓ Created pull request: #1\n#   Title: Add a favorites feature and dark mode\n#   Branch: theme → main\n#   URL: https://github.com/user/recipe-blog/pull/1\n\n# 9. Wait for deployment to complete, type open to preview and review\nopen\n# Opens preview deployment in browser\n\n# 10. Merge the PR\ncosmic repos pr merge \u003crepoId\u003e 1\n# Auto deploys to production. Type open again to view live.\nopen\n```\n\n### Agent Workflow\n\n```bash\n# Create a scheduled content agent\ncosmic agents create \\\n  --type content \\\n  --name \"Weekly Roundup\" \\\n  --prompt \"Create a weekly summary of new products\" \\\n  --schedule \\\n  --schedule-frequency weekly\n\n# Create a repository agent\ncosmic agents create \\\n  --type repo \\\n  --name \"Bug Fixer\" \\\n  --prompt \"Fix the accessibility issues\" \\\n  --run\n\n# Create PR from agent's work\ncosmic agents pr \u003cagentId\u003e\n```\n\n### Computer Use Agent with Auth\n\n```bash\n# Capture authentication\ncosmic agents capture-auth --url https://dashboard.example.com/login\n# (Browser opens, log in, click \"Done - Capture Auth\")\n# Returns session ID: abc123...\n\n# Create agent with pre-captured auth\ncosmic agents create \\\n  --type computer_use \\\n  --name \"Dashboard Reporter\" \\\n  --start-url \"https://dashboard.example.com\" \\\n  --prompt \"Screenshot the weekly metrics\" \\\n  --auth-session abc123...\n```\n\n### Multi-Step Workflow\n\n```bash\n# Create workflow with initial agent\ncosmic workflows create --name \"Content Pipeline\" --agent writer-id\n\n# Add more steps\ncosmic workflows add-step \u003cworkflowId\u003e --agent editor-id\ncosmic workflows add-step \u003cworkflowId\u003e --agent publisher-id\n\n# Execute\ncosmic workflows run \u003cworkflowId\u003e\n\n# Monitor\ncosmic workflows executions \u003cexecutionId\u003e\n```\n\n## Global Options\n\nAll commands support:\n\n```bash\n--json          # Output as JSON (for scripting)\n--verbose, -v   # Enable verbose output\n--no-color      # Disable colored output\n```\n\n## Environment Variables\n\n```bash\nCOSMIC_DEBUG=1  # Enable debug output\n```\n\n## Development\n\n```bash\ngit clone https://github.com/cosmicjs/cli.git\ncd cli\nbun install\nbun run build\nbun run dev\n```\n\n## Testing\n\nThe CLI includes an integration test suite that runs against a real Cosmic bucket using your existing CLI credentials.\n\n### Prerequisites\n\n1. Log in to your Cosmic account:\n   ```bash\n   cosmic login\n   ```\n2. Select a bucket to test against:\n   ```bash\n   cosmic use\n   ```\n\n### Running Tests\n\n```bash\nbun test\n```\n\nThis runs all tests sequentially via [Vitest](https://vitest.dev/). Each test creates resources, verifies them, and cleans up after itself. If you're not logged in or no bucket is selected, the tests will skip with a helpful message.\n\n### Test Coverage\n\n| File | Area | Operations |\n|------|------|------------|\n| `objects.test.ts` | Objects (SDK) | Create, list, get, update, delete, publish, unpublish |\n| `types.test.ts` | Object Types (Dashboard API) | Create, list, get, update, duplicate, delete |\n| `media.test.ts` | Media \u0026 Folders (Dashboard API) | List, upload, get, delete media; create, list, update, delete folders |\n| `webhooks.test.ts` | Webhooks (Dashboard API) | Create, list, get, update, delete |\n| `ai.test.ts` | AI (Dashboard API) | List models, generate text, generate audio |\n| `workflows.test.ts` | Workflows (Dashboard API) | Create, list, get, update, delete |\n| `agents.test.ts` | Agents (Dashboard API) | List, get (read-only) |\n\n## Support\n\n- [Cosmic Documentation](https://www.cosmicjs.com/docs)\n- [Full CLI Reference](docs/CLI_REFERENCE.md)\n- [Discord Community](https://discord.gg/MSCwQ7D6Mg)\n- [GitHub Issues](https://github.com/cosmicjs/cli/issues)\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmicjs%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmicjs%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmicjs%2Fcli/lists"}