From 1d54512b7eccb7ec07c4b14f78e191afc7c9e991 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sun, 28 Jun 2026 11:58:09 +0000 Subject: [PATCH] chore(base44-cli): sync skill to v0.1.0 Co-Authored-By: Claude Sonnet 4.6 --- CLI_VERSION | 2 +- skills/base44-cli/SKILL.md | 17 ++++- .../references/connectors-initiate.md | 64 +++++++++++++++++ .../base44-cli/references/connectors-pull.md | 19 +++-- .../base44-cli/references/connectors-push.md | 10 ++- .../references/sandbox-checkpoint.md | 44 ++++++++++++ skills/base44-cli/references/sandbox-edit.md | 71 +++++++++++++++++++ skills/base44-cli/references/sandbox-grep.md | 60 ++++++++++++++++ skills/base44-cli/references/sandbox-ls.md | 57 +++++++++++++++ skills/base44-cli/references/sandbox-read.md | 51 +++++++++++++ skills/base44-cli/references/sandbox-run.md | 54 ++++++++++++++ skills/base44-cli/references/sandbox-write.md | 50 +++++++++++++ skills/base44-troubleshooter/SKILL.md | 6 +- .../references/project-logs.md | 19 +++-- 14 files changed, 509 insertions(+), 15 deletions(-) create mode 100644 skills/base44-cli/references/connectors-initiate.md create mode 100644 skills/base44-cli/references/sandbox-checkpoint.md create mode 100644 skills/base44-cli/references/sandbox-edit.md create mode 100644 skills/base44-cli/references/sandbox-grep.md create mode 100644 skills/base44-cli/references/sandbox-ls.md create mode 100644 skills/base44-cli/references/sandbox-read.md create mode 100644 skills/base44-cli/references/sandbox-run.md create mode 100644 skills/base44-cli/references/sandbox-write.md diff --git a/CLI_VERSION b/CLI_VERSION index 72e83b9..b82608c 100644 --- a/CLI_VERSION +++ b/CLI_VERSION @@ -1 +1 @@ -v0.0.56 +v0.1.0 diff --git a/skills/base44-cli/SKILL.md b/skills/base44-cli/SKILL.md index bed8bd4..de67d16 100644 --- a/skills/base44-cli/SKILL.md +++ b/skills/base44-cli/SKILL.md @@ -4,7 +4,7 @@ description: "The base44 CLI is used for EVERYTHING related to base44 projects: metadata: sourcePackage: name: base44 - version: 0.0.56 + version: 0.1.0 --- # Base44 CLI @@ -345,6 +345,7 @@ Connectors let your app connect to external services (Google Calendar, Slack, St | ---------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------- | | Create Connectors | Define connectors in `base44/connectors` folder | [connectors-create.md](references/connectors-create.md) | | `base44 connectors list-available` | List all available integration types from Base44 | [connectors-list-available.md](references/connectors-list-available.md) | +| `base44 connectors initiate --integration-type ` | Initialize a single connector and start its OAuth flow (works with `--app-id`) | [connectors-initiate.md](references/connectors-initiate.md) | | `base44 connectors pull` | Pull remote connectors to local files | [connectors-pull.md](references/connectors-pull.md) | | `base44 connectors push` | Push local connectors to Base44 | [connectors-push.md](references/connectors-push.md) | @@ -398,6 +399,20 @@ Manage project secrets (environment variables stored securely in Base44). These | `base44 secrets set` | Set one or more secrets (KEY=VALUE or --env-file) | [secrets-set.md](references/secrets-set.md) | | `base44 secrets delete ` | Delete a secret by name | [secrets-delete.md](references/secrets-delete.md) | +### Remote Development (Sandbox) + +Develop an app remotely via its server-side sandbox. All sandbox commands require an app context (`--app-id`, `BASE44_APP_ID`, or a linked project) and output JSON. + +| Command | Description | Reference | +|---------|-------------|-----------| +| `base44 sandbox ls [path]` | List directory entries in the remote sandbox | [sandbox-ls.md](references/sandbox-ls.md) | +| `base44 sandbox read ` | Read file contents from the remote sandbox | [sandbox-read.md](references/sandbox-read.md) | +| `base44 sandbox write ` | Create or overwrite a file in the remote sandbox | [sandbox-write.md](references/sandbox-write.md) | +| `base44 sandbox edit ` | Apply exact old→new string edits to a file | [sandbox-edit.md](references/sandbox-edit.md) | +| `base44 sandbox grep ` | Search files by pattern in the remote sandbox | [sandbox-grep.md](references/sandbox-grep.md) | +| `base44 sandbox run ` | Run a shell command in the remote sandbox | [sandbox-run.md](references/sandbox-run.md) | +| `base44 sandbox checkpoint` | Create a restore-point checkpoint of the sandbox | [sandbox-checkpoint.md](references/sandbox-checkpoint.md) | + ### Script Execution Run one-off scripts against your app with the Base44 SDK pre-authenticated. Use it to perform CRUD operations on entities (`base44.entities.MyEntity.list/create/update/delete`), call backend functions (`base44.functions.invoke("myFunction", args)`), invoke agents, or access any other resource exposed by the SDK — without deploying a full function. Useful for data migrations, bulk operations, debugging, and scripted workflows. diff --git a/skills/base44-cli/references/connectors-initiate.md b/skills/base44-cli/references/connectors-initiate.md new file mode 100644 index 0000000..827fb02 --- /dev/null +++ b/skills/base44-cli/references/connectors-initiate.md @@ -0,0 +1,64 @@ +# base44 connectors initiate + +Initialize a connector on an app and start its OAuth flow. Works without a local project — pass `--app-id` or set `BASE44_APP_ID`. + +## Syntax + +```bash +npx base44 connectors initiate --integration-type [--scopes ] +``` + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--integration-type ` | Integration type to initiate (e.g. `googlecalendar`, `gmail`, `slack`) | Yes | +| `--scopes ` | OAuth scopes to request (space- or comma-separated) | No | + +## What It Does + +1. Calls the Base44 API to initialize the connector for the given integration type +2. If the connector is already authorized, reports that and exits (run `connectors pull` to fetch its config) +3. Otherwise, opens a browser window for OAuth authorization (interactive mode) or prints the authorization URL (non-interactive / `--json` mode) +4. In interactive mode, polls until authorization completes + +## Examples + +```bash +# Initialize Google Calendar connector (no scopes — uses provider defaults) +npx base44 connectors initiate --integration-type googlecalendar + +# Initialize Google Calendar with specific scopes +npx base44 connectors initiate --integration-type googlecalendar --scopes https://www.googleapis.com/auth/calendar + +# Initialize Gmail with comma-separated scopes +npx base44 connectors initiate --integration-type gmail --scopes scope.a,scope.b + +# Initialize against a specific app without a local project +npx base44 connectors initiate --app-id app_123 --integration-type slack +``` + +## JSON Output + +Under `--json`, the command emits a machine-readable result and does not open a browser or poll. The caller is responsible for opening `redirectUrl` to complete authorization: + +```json +{ + "integrationType": "googlecalendar", + "alreadyAuthorized": false, + "redirectUrl": "https://auth.base44.io/oauth/...", + "connectionId": "conn_abc123" +} +``` + +## Notes + +- Use `connectors initiate` when you need to authorize a single connector outside of the full `connectors push` flow +- After authorization completes, run `npx base44 connectors pull` to fetch the connector config to local files +- Scopes can be passed space-separated (`--scopes a b c`) or comma-joined (`--scopes a,b,c`) or mixed + +## Related Commands + +- [connectors-create.md](connectors-create.md) - How to create connector config files +- [connectors-push.md](connectors-push.md) - Push all local connectors and authorize in one step +- [connectors-pull.md](connectors-pull.md) - Pull connector configs to local files diff --git a/skills/base44-cli/references/connectors-pull.md b/skills/base44-cli/references/connectors-pull.md index 97502a5..4093eb4 100644 --- a/skills/base44-cli/references/connectors-pull.md +++ b/skills/base44-cli/references/connectors-pull.md @@ -5,24 +5,30 @@ Pull connector configurations from Base44 to local files. Replaces all local con ## Syntax ```bash -npx base44 connectors pull +npx base44 connectors pull [options] ``` ## Authentication **Required**: Yes. If not authenticated, you'll be prompted to login first. +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--dir ` | Directory to write connector files to (default: `./connectors` when using `--app-id`) | No | + ## What It Does 1. Fetches all connectors from Base44 -2. Writes connector files to the `base44/connectors/` directory +2. Writes connector files to the connectors directory 3. Deletes local connector files that don't exist remotely 4. Reports written and deleted connectors ## Prerequisites -- Must be run from a Base44 project directory -- Project must be linked to a Base44 app +- Must be run from a linked Base44 project, OR pass `--app-id` / set `BASE44_APP_ID` +- When using `--app-id`, connector files are written to `./connectors/` by default (override with `--dir`) ## Output @@ -68,8 +74,9 @@ All connectors are already up to date ## Notes -- Connector files are stored as `.jsonc` in the `base44/connectors/` directory -- The directory location is configurable via `connectorsDir` in `config.jsonc` +- Connector files are stored as `.jsonc` +- For linked projects, the directory is `base44/connectors/` (configurable via `connectorsDir` in `config.jsonc`) +- For projectless use (`--app-id`), defaults to `./connectors/` (override with `--dir`) - Use `base44 connectors push` to upload local changes to Base44 ## Related Commands diff --git a/skills/base44-cli/references/connectors-push.md b/skills/base44-cli/references/connectors-push.md index b509512..94989dc 100644 --- a/skills/base44-cli/references/connectors-push.md +++ b/skills/base44-cli/references/connectors-push.md @@ -5,12 +5,18 @@ Push local connector configurations to Base44, synchronizing scopes and handling ## Usage ```bash -npx base44 connectors push +npx base44 connectors push [options] ``` +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--dir ` | Directory to read connector files from (default: `./connectors` when using `--app-id`) | No | + ## What It Does -1. **Reads local connectors** from your `base44/connectors/` directory +1. **Reads local connectors** from your `base44/connectors/` directory (or `--dir` when using `--app-id`) 2. **Syncs with Base44** - updates scopes for existing connectors 3. **Adds new connectors** - new OAuth connector types trigger authorization; Stripe is provisioned automatically 4. **Removes unlisted connectors** - connectors not in your local files are removed from Base44 diff --git a/skills/base44-cli/references/sandbox-checkpoint.md b/skills/base44-cli/references/sandbox-checkpoint.md new file mode 100644 index 0000000..afdd52b --- /dev/null +++ b/skills/base44-cli/references/sandbox-checkpoint.md @@ -0,0 +1,44 @@ +# base44 sandbox checkpoint + +Create a restore-point checkpoint of an app's remote sandbox. + +## Syntax + +```bash +npx base44 sandbox checkpoint [options] +``` + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--name ` | Optional message/title for the checkpoint (defaults to an auto-generated title) | No | + +## Examples + +```bash +# Create a checkpoint with an auto-generated title +npx base44 sandbox checkpoint + +# Create a checkpoint with a descriptive name +npx base44 sandbox checkpoint --name "before refactor" + +# Checkpoint against a specific app +npx base44 sandbox checkpoint --app-id app_123 --name "pre-migration" +``` + +## Output + +Returns a JSON document with the checkpoint details (ID, name, timestamp). + +## Notes + +- Requires app context (`--app-id`, `BASE44_APP_ID`, or a linked project) +- Use checkpoints before making risky edits (e.g., large refactors, schema migrations) +- Checkpoints can be restored from the Base44 dashboard + +## Related Commands + +- [sandbox-run.md](sandbox-run.md) - Run commands in the sandbox +- [sandbox-edit.md](sandbox-edit.md) - Edit files in the sandbox +- [sandbox-write.md](sandbox-write.md) - Write files in the sandbox diff --git a/skills/base44-cli/references/sandbox-edit.md b/skills/base44-cli/references/sandbox-edit.md new file mode 100644 index 0000000..dd37985 --- /dev/null +++ b/skills/base44-cli/references/sandbox-edit.md @@ -0,0 +1,71 @@ +# base44 sandbox edit + +Apply exact old→new string edits to a file in an app's remote sandbox. + +## Syntax + +```bash +npx base44 sandbox edit [options] +# or pipe edits JSON via stdin +echo '[{"old_text":"foo","new_text":"bar"}]' | npx base44 sandbox edit +``` + +## Arguments + +| Argument | Description | Required | +|----------|-------------|----------| +| `` | File path relative to the app root | Yes | + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--edits-json ` | JSON array of edits (if omitted, read from stdin) | No | +| `--dry-run` | Return the unified diff without writing | No | + +## Edit Format + +Each edit is a JSON object: + +```json +{ + "old_text": "exact string to find", + "new_text": "replacement string", + "replace_all": true +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `old_text` | string (non-empty) | Exact text to find in the file | +| `new_text` | string | Replacement text (can be empty to delete) | +| `replace_all` | boolean (optional) | Replace all occurrences (default: replace first only) | + +## Examples + +```bash +# Single edit via flag +npx base44 sandbox edit src/index.ts --edits-json '[{"old_text":"foo","new_text":"bar"}]' + +# Multiple edits via stdin +echo '[{"old_text":"foo","new_text":"bar"},{"old_text":"baz","new_text":"qux"}]' \ + | npx base44 sandbox edit src/index.ts + +# Preview without writing +npx base44 sandbox edit src/index.ts --dry-run \ + --edits-json '[{"old_text":"a","new_text":"b","replace_all":true}]' +``` + +## Notes + +- Requires app context (`--app-id`, `BASE44_APP_ID`, or a linked project) +- All paths are relative to the app root +- Edits are applied in order; each edit operates on the state after prior edits +- Use `--dry-run` to verify edits before applying them +- Returns JSON with the edit result (or diff when `--dry-run`) + +## Related Commands + +- [sandbox-read.md](sandbox-read.md) - Read file contents first to construct edits +- [sandbox-write.md](sandbox-write.md) - Full file overwrite +- [sandbox-grep.md](sandbox-grep.md) - Find patterns before editing diff --git a/skills/base44-cli/references/sandbox-grep.md b/skills/base44-cli/references/sandbox-grep.md new file mode 100644 index 0000000..959d133 --- /dev/null +++ b/skills/base44-cli/references/sandbox-grep.md @@ -0,0 +1,60 @@ +# base44 sandbox grep + +Search files for a pattern in an app's remote sandbox. + +## Syntax + +```bash +npx base44 sandbox grep [options] +``` + +## Arguments + +| Argument | Description | Required | +|----------|-------------|----------| +| `` | Search pattern (regex by default) | Yes | + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--path ` | Subtree to search, relative to the app root | No | +| `--no-regex` | Treat the pattern as a literal string, not a regex | No | +| `--case-sensitive` | Case-sensitive match | No | +| `--glob ` | File glob filter (e.g. `"*.tsx"`) | No | +| `--max-results ` | Maximum number of match lines to return | No | + +## Examples + +```bash +# Search for a pattern across all files +npx base44 sandbox grep "fetchUser" + +# Search only in src/ +npx base44 sandbox grep "fetchUser" --path src + +# Literal string search (no regex) +npx base44 sandbox grep "user.email" --no-regex + +# Case-sensitive search in TypeScript files +npx base44 sandbox grep "useState" --case-sensitive --glob "*.tsx" + +# Limit results +npx base44 sandbox grep "TODO" --max-results 20 +``` + +## Output + +Returns a JSON document with matching lines, their file paths, and line numbers. + +## Notes + +- Requires app context (`--app-id`, `BASE44_APP_ID`, or a linked project) +- Patterns are treated as regular expressions by default; use `--no-regex` for literal matching +- Search is case-insensitive by default; use `--case-sensitive` to match case exactly + +## Related Commands + +- [sandbox-read.md](sandbox-read.md) - Read a specific file after finding it +- [sandbox-edit.md](sandbox-edit.md) - Edit a file after locating the target text +- [sandbox-ls.md](sandbox-ls.md) - List directory structure diff --git a/skills/base44-cli/references/sandbox-ls.md b/skills/base44-cli/references/sandbox-ls.md new file mode 100644 index 0000000..7095f3d --- /dev/null +++ b/skills/base44-cli/references/sandbox-ls.md @@ -0,0 +1,57 @@ +# base44 sandbox ls + +List directory entries in an app's remote sandbox. + +## Syntax + +```bash +npx base44 sandbox ls [path] [options] +``` + +## Arguments + +| Argument | Description | Required | +|----------|-------------|----------| +| `[path]` | Directory relative to the app root (default: app root) | No | + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--recursive` | List nested entries | No | +| `--max-depth ` | Max depth when recursive (1-10, default: 3) | No | +| `--include-hidden` | Include dotfiles | No | + +## Examples + +```bash +# List the app root +npx base44 sandbox ls + +# List the src directory +npx base44 sandbox ls src + +# Recursive listing +npx base44 sandbox ls --recursive + +# Recursive with depth limit +npx base44 sandbox ls src --recursive --max-depth 2 + +# Include hidden files +npx base44 sandbox ls --include-hidden +``` + +## Output + +Returns a JSON document with directory entries (names, types, sizes). + +## Notes + +- Requires app context (`--app-id`, `BASE44_APP_ID`, or a linked project) +- All paths are relative to the app root + +## Related Commands + +- [sandbox-read.md](sandbox-read.md) - Read file contents +- [sandbox-write.md](sandbox-write.md) - Write a file +- [sandbox-grep.md](sandbox-grep.md) - Search files by pattern diff --git a/skills/base44-cli/references/sandbox-read.md b/skills/base44-cli/references/sandbox-read.md new file mode 100644 index 0000000..85b41be --- /dev/null +++ b/skills/base44-cli/references/sandbox-read.md @@ -0,0 +1,51 @@ +# base44 sandbox read + +Read file contents from an app's remote sandbox. + +## Syntax + +```bash +npx base44 sandbox read [options] +``` + +## Arguments + +| Argument | Description | Required | +|----------|-------------|----------| +| `` | One or more file paths relative to the app root | Yes | + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--offset ` | 1-based start line | No | +| `--limit ` | Max lines to return from offset | No | + +## Examples + +```bash +# Read a single file +npx base44 sandbox read src/index.ts + +# Read multiple files +npx base44 sandbox read src/index.ts src/utils.ts + +# Read lines 10-20 of a file +npx base44 sandbox read src/index.ts --offset 10 --limit 10 +``` + +## Output + +Returns a JSON document with file contents. When multiple paths are given, each file's content is included in the response. + +## Notes + +- Requires app context (`--app-id`, `BASE44_APP_ID`, or a linked project) +- All paths are relative to the app root +- Use `--offset` and `--limit` to paginate large files + +## Related Commands + +- [sandbox-ls.md](sandbox-ls.md) - List directory entries +- [sandbox-write.md](sandbox-write.md) - Write a file +- [sandbox-edit.md](sandbox-edit.md) - Apply exact edits to a file diff --git a/skills/base44-cli/references/sandbox-run.md b/skills/base44-cli/references/sandbox-run.md new file mode 100644 index 0000000..63d112b --- /dev/null +++ b/skills/base44-cli/references/sandbox-run.md @@ -0,0 +1,54 @@ +# base44 sandbox run + +Run a shell command in an app's remote sandbox. + +## Syntax + +```bash +npx base44 sandbox run [options] +``` + +## Arguments + +| Argument | Description | Required | +|----------|-------------|----------| +| `` | Shell command to execute (quote to keep as one argument) | Yes | + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--cwd ` | Working directory relative to the app root | No | +| `--timeout-ms ` | Timeout in milliseconds (default: 120000, max: 600000) | No | + +## Examples + +```bash +# Run a test suite +npx base44 sandbox run "npm test" + +# Run ls with arguments +npx base44 sandbox run ls -la --cwd src + +# Run with a custom timeout +npx base44 sandbox run "npm run build" --timeout-ms 300000 + +# Run in a specific directory +npx base44 sandbox run "cat package.json" --cwd packages/cli +``` + +## Output + +Returns a JSON document with the command output, exit code, and stderr. The CLI always exits 0 (the HTTP call succeeded); the remote command's exit code is reported in the JSON response. + +## Notes + +- Requires app context (`--app-id`, `BASE44_APP_ID`, or a linked project) +- The working directory defaults to the app root; use `--cwd` to change it +- The CLI exit code reflects whether the API call succeeded, not the remote command's exit code — check the JSON response for the remote exit code + +## Related Commands + +- [sandbox-ls.md](sandbox-ls.md) - List directory entries +- [sandbox-read.md](sandbox-read.md) - Read output files +- [sandbox-checkpoint.md](sandbox-checkpoint.md) - Checkpoint before risky operations diff --git a/skills/base44-cli/references/sandbox-write.md b/skills/base44-cli/references/sandbox-write.md new file mode 100644 index 0000000..05c2998 --- /dev/null +++ b/skills/base44-cli/references/sandbox-write.md @@ -0,0 +1,50 @@ +# base44 sandbox write + +Create or overwrite a file in an app's remote sandbox. + +## Syntax + +```bash +npx base44 sandbox write [options] +# or pipe content via stdin +echo "content" | npx base44 sandbox write +``` + +## Arguments + +| Argument | Description | Required | +|----------|-------------|----------| +| `` | File path relative to the app root | Yes | + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--content ` | File content (if omitted, read from stdin) | No | +| `--overwrite` | Overwrite the file if it already exists | No | + +## Examples + +```bash +# Write content via stdin +echo "hello world" | npx base44 sandbox write notes.txt + +# Write content via flag +npx base44 sandbox write notes.txt --content "hello world" --overwrite + +# Write a multi-line file via stdin +cat local-file.ts | npx base44 sandbox write src/remote-file.ts --overwrite +``` + +## Notes + +- Requires app context (`--app-id`, `BASE44_APP_ID`, or a linked project) +- All paths are relative to the app root +- Content can come from `--content` flag or piped stdin; if neither is provided and stdin is a TTY, the command throws an error +- Returns JSON with the write result + +## Related Commands + +- [sandbox-read.md](sandbox-read.md) - Read file contents +- [sandbox-edit.md](sandbox-edit.md) - Apply exact old→new edits instead of full overwrite +- [sandbox-ls.md](sandbox-ls.md) - List directory entries diff --git a/skills/base44-troubleshooter/SKILL.md b/skills/base44-troubleshooter/SKILL.md index 60a346f..16324c5 100644 --- a/skills/base44-troubleshooter/SKILL.md +++ b/skills/base44-troubleshooter/SKILL.md @@ -57,9 +57,13 @@ npx base44 logs --app-id app_123 --function --level error ### 3. Inspect a Time Range -Correlate with user-reported issue timestamps: +Correlate with user-reported issue timestamps. Use relative shorthands (`1h`, `30m`, `2d`) or ISO datetimes: ```bash +# Last hour +npx base44 logs --function --since 1h + +# Specific range npx base44 logs --function --since --until ``` diff --git a/skills/base44-troubleshooter/references/project-logs.md b/skills/base44-troubleshooter/references/project-logs.md index 6b14b1d..3cdc498 100644 --- a/skills/base44-troubleshooter/references/project-logs.md +++ b/skills/base44-troubleshooter/references/project-logs.md @@ -15,11 +15,12 @@ This command can run from a linked project, or outside a project when you pass ` | Option | Description | Required | |--------|-------------|----------| | `--function ` | Filter by function name(s), comma-separated. If omitted, fetches logs for all functions in the current app | No | -| `--since ` | Show logs from this time (ISO format) | No | -| `--until ` | Show logs until this time (ISO format) | No | +| `--since ` | Show logs from this time. ISO datetime or relative shorthand (e.g. `1h`, `30m`, `2d`) | No | +| `--until ` | Show logs until this time. ISO datetime or relative shorthand (e.g. `1h`, `30m`, `2d`) | No | | `--level ` | Filter by log level: `log`, `info`, `warn`, `error`, `debug` | No | | `-n, --limit ` | Number of results to return (1-1000, default: 50) | No | | `--order ` | Sort order: `asc` or `desc` (default: `desc`) | No | +| `--json` | Output as JSON (clean stdout, safe to pipe to `jq`) | No | ## Examples @@ -39,7 +40,13 @@ npx base44 logs --function my-function # Fetch logs for multiple functions npx base44 logs --function send-email,process-payment -# Fetch logs since a specific time +# Fetch logs from the last hour (relative shorthand) +npx base44 logs --since 1h + +# Fetch logs from the last 30 minutes +npx base44 logs --since 30m + +# Fetch logs since a specific time (ISO format) npx base44 logs --since 2024-01-15T10:00:00 # Fetch logs within a time range @@ -50,6 +57,9 @@ npx base44 logs -n 100 --order asc # Last 10 errors for a specific function npx base44 logs --function myFunction --level error --limit 10 + +# Output as JSON (pipe to jq) +npx base44 logs --json | jq '.[].message' ``` ## Notes @@ -59,4 +69,5 @@ npx base44 logs --function myFunction --level error --limit 10 - When multiple functions are specified, logs are merged and sorted by timestamp. - If `--function` is omitted, logs are fetched for **all functions** in the current app. - The `--limit` applies after merging logs from all specified functions. -- The `--since` and `--until` values are normalized to UTC if no timezone is provided (appends `Z`). +- The `--since` and `--until` values accept ISO datetime strings or relative shorthands (`1h`, `30m`, `2d`). ISO values without a timezone are normalized to UTC (appends `Z`). +- Use `--json` to get machine-readable output safe to pipe to `jq` or other tools.