insforge-cli
Original:🇺🇸 English
Translated
Create and manage InsForge projects using the CLI. Handles authentication, project setup, database management, edge functions, storage, deployments, and secrets. For writing application code with the InsForge SDK, use the insforge (SDK) skill instead.
379installs
Sourceinsforge/agent-skills
Added on
NPX Install
npx skill4agent add insforge/agent-skills insforge-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →InsForge CLI
Command-line tool for managing InsForge Backend-as-a-Service projects.
Critical: Session Start Checks
bash
insforge whoami # verify authentication
insforge current # verify linked projectIf not authenticated:
If no project linked: (new) or (existing)
insforge logininsforge createinsforge linkGlobal Options
| Flag | Description |
|---|---|
| Structured JSON output (for scripts and agents) |
| Override linked project ID |
| Skip confirmation prompts |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Not authenticated |
| 3 | Project not linked |
| 4 | Resource not found |
| 5 | Permission denied |
Environment Variables
| Variable | Description |
|---|---|
| Override stored access token |
| Override linked project ID |
| Email for non-interactive login |
| Password for non-interactive login |
Commands
Authentication
- — OAuth (browser) or
insforge loginfor password login. See references/login.md--email - — clear stored credentials
insforge logout - — show current user
insforge whoami
Project Management
- — create new project. See references/create.md
insforge create - — link directory to existing project
insforge link - — show current user + linked project
insforge current - — list all orgs and projects
insforge list
Database — insforge db
insforge db- — execute raw SQL. See references/db-query.md
insforge db query <sql> - — inspect schema
insforge db tables / indexes / policies / triggers / functions - — call database function (GET if no data, POST if data)
insforge db rpc <fn> [--data <json>] - — export schema/data. See references/db-export.md
insforge db export - — import from SQL file. See references/db-import.md
insforge db import <file>
Edge Functions — insforge functions
insforge functions- — list deployed functions
insforge functions list - — view function source
insforge functions code <slug> - — deploy or update. See references/functions-deploy.md
insforge functions deploy <slug> - — invoke function
insforge functions invoke <slug> [--data <json>] [--method GET|POST]
Storage — insforge storage
insforge storage- — list buckets
insforge storage buckets - — create bucket (default: public)
insforge storage create-bucket <name> [--private] - — delete bucket and all its objects (destructive)
insforge storage delete-bucket <name> - — list objects
insforge storage list-objects <bucket> [--prefix] [--search] [--limit] [--sort] - — upload file
insforge storage upload <file> --bucket <name> [--key <objectKey>] - — download file
insforge storage download <objectKey> --bucket <name> [--output <path>]
Deployments — insforge deployments
insforge deployments- — deploy frontend app. See references/deployments-deploy.md
insforge deployments deploy [dir] - — list deployments
insforge deployments list - — get deployment status (--sync fetches from Vercel)
insforge deployments status <id> [--sync] - — cancel running deployment
insforge deployments cancel <id>
Secrets — insforge secrets
insforge secrets- — list secrets (values hidden;
insforge secrets list [--all]includes deleted)--all - — get decrypted value
insforge secrets get <key> - — create secret
insforge secrets add <key> <value> [--reserved] [--expires <ISO date>] - — update secret
insforge secrets update <key> [--value] [--active] [--reserved] [--expires] - — soft delete (marks inactive; restore with
insforge secrets delete <key>)--active true
Schedules — insforge schedules
insforge schedules- — list all scheduled tasks (shows ID, name, cron, URL, method, active, next run)
insforge schedules list - — get schedule details
insforge schedules get <id> - — create a cron job (5-field cron format only)
insforge schedules create --name --cron --url --method [--headers <json>] [--body <json>] - — update schedule
insforge schedules update <id> [--name] [--cron] [--url] [--method] [--headers] [--body] [--active] - — delete schedule (with confirmation)
insforge schedules delete <id> - — view execution logs
insforge schedules logs <id> [--limit] [--offset]
Logs — insforge logs
insforge logs- — fetch backend container logs (default: 20 entries)
insforge logs <source> [--limit <n>]
| Source | Description |
|---|---|
| Main backend logs |
| PostgREST API layer logs |
| PostgreSQL database logs |
| Edge function execution logs |
Source names are case-insensitive:works the same aspostgrest.logs.postgREST.logs
Documentation — insforge docs
insforge docs- — list all topics
insforge docs - — setup guide
insforge docs instructions - — feature docs (
insforge docs <feature> <language>×db / storage / functions / auth / ai / realtime)typescript / swift / kotlin / rest-api
Non-Obvious Behaviors
Functions invoke URL: invoked at — NOT . Exits with code 1 on HTTP 400+.
{oss_host}/functions/{slug}/api/functions/{slug}Secrets delete is soft: marks the secret inactive, not destroyed. Restore with . Use with to see inactive ones.
insforge secrets update KEY --active true--allsecrets listStorage delete-bucket is hard: deletes the bucket and every object inside it permanently.
db rpc uses GET or POST: no → GET; with → POST.
--data--dataSchedules use 5-field cron only: . 6-field (with seconds) is NOT supported. Headers can reference secrets with .
minute hour day month day-of-week${{secrets.KEY_NAME}}Common Workflows
Set up database schema
bash
insforge db query "CREATE TABLE posts (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
title TEXT NOT NULL,
content TEXT,
author_id UUID REFERENCES auth.users(id),
created_at TIMESTAMPTZ DEFAULT now()
)"
insforge db query "ALTER TABLE posts ENABLE ROW LEVEL SECURITY"
insforge db query "CREATE POLICY \"public_read\" ON posts FOR SELECT USING (true)"
insforge db query "CREATE POLICY \"owner_write\" ON posts FOR INSERT WITH CHECK (auth.uid() = author_id)"FK to users: always. RLS current user:auth.users(id).auth.uid()
Deploy an edge function
bash
# Default source path: insforge/functions/{slug}/index.ts
insforge functions deploy my-handler
insforge functions invoke my-handler --data '{"action": "test"}'Deploy frontend
bash
npm run build
insforge deployments deploy ./dist --env '{"VITE_API_URL": "https://my-app.us-east.insforge.app"}'Always build locally first. Env var prefix depends on framework:,VITE_*,NEXT_PUBLIC_*.REACT_APP_*
Backup and restore database
bash
insforge db export --output backup.sql
insforge db import backup.sqlSchedule a cron job
bash
# Create a schedule that calls a function every 5 minutes
insforge schedules create \
--name "Cleanup Expired" \
--cron "*/5 * * * *" \
--url "https://my-app.us-east.insforge.app/functions/cleanup" \
--method POST \
--headers '{"Authorization": "Bearer ${{secrets.API_TOKEN}}"}'
# Check execution history
insforge schedules logs <id>Debug with logs
bash
insforge logs function.logs # function execution issues
insforge logs postgres.logs # database query problems
insforge logs insforge.logs # API / auth errors
insforge logs postgrest.logs --limit 50Non-interactive CI/CD
bash
INSFORGE_EMAIL=$EMAIL INSFORGE_PASSWORD=$PASSWORD insforge login --email -y
insforge link --project-id $PROJECT_ID --org-id $ORG_ID -y
insforge db query "SELECT count(*) FROM users" --jsonProject Configuration
After or , is created:
createlink.insforge/project.jsonjson
{
"project_id": "...",
"appkey": "...",
"region": "us-east",
"api_key": "ik_...",
"oss_host": "https://{appkey}.{region}.insforge.app"
}oss_hostapi_key