diff --git a/CLI_VERSION b/CLI_VERSION index 72e83b9..a1c2c6a 100644 --- a/CLI_VERSION +++ b/CLI_VERSION @@ -1 +1 @@ -v0.0.56 +v0.1.1 \ No newline at end of file diff --git a/skills/base44-cli/SKILL.md b/skills/base44-cli/SKILL.md index bed8bd4..d7cefa4 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.1 --- # Base44 CLI @@ -192,6 +192,29 @@ npx base44 **Note:** All commands in this documentation use `npx base44`. You can also use `yarn base44`, or `pnpm base44` if preferred. +## Global `--json` Option + +The CLI has a global `--json` flag that switches all commands to machine-readable mode: + +- **stdout** contains a single JSON document (the command's data output) +- **Human-oriented status messages, spinners, and logs** go to stderr (stdout stays clean) +- **Forces non-interactive mode**: prompts and OAuth browser flows are skipped + +Use `--json` when you need to parse or pipe command output programmatically: + +```bash +# Get connector list as JSON +npx base44 connectors list-available --json | jq '.integrations[].integrationType' + +# Get logs as JSON +npx base44 logs --json | jq '.[] | select(.level == "error")' + +# Initiate a connector and extract the redirect URL +npx base44 connectors initiate --app-id app_123 --integration-type googlecalendar --json | jq -r '.redirectUrl' +``` + +Commands that do not produce data output (e.g. `deploy`) still return `{ "output": "" }` so stdout is always valid JSON. + ## Global `--app-id` Option The CLI has a global `--app-id ` option for commands that only need an app context, not local project files. @@ -345,6 +368,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` | Initialize a connector and start its OAuth flow (works without a local project) | [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) | @@ -416,6 +440,20 @@ Run one-off scripts against your app with the Base44 SDK pre-authenticated. Use **No authentication required.** Runs entirely locally. Automatically updates `tsconfig.json` to include the generated types. +### Remote Sandbox Development + +Interact with an app's server-side sandbox — read, write, edit, search, and run commands remotely. All sandbox commands work from a linked project directory or with `--app-id` / `BASE44_APP_ID`. + +| Command | Description | Reference | +|---------|-------------|-----------| +| `base44 sandbox ls [path]` | List directory entries in an app's remote sandbox | [sandbox-list-directory.md](references/sandbox-list-directory.md) | +| `base44 sandbox read ` | Read file contents from an app's remote sandbox | [sandbox-read-file.md](references/sandbox-read-file.md) | +| `base44 sandbox write ` | Create or overwrite a file in an app's remote sandbox | [sandbox-write-file.md](references/sandbox-write-file.md) | +| `base44 sandbox edit ` | Apply exact old→new string edits to a file in the sandbox | [sandbox-edit-file.md](references/sandbox-edit-file.md) | +| `base44 sandbox grep ` | Search files for a pattern in an app's remote sandbox | [sandbox-grep.md](references/sandbox-grep.md) | +| `base44 sandbox run ` | Run a shell command in an app's remote sandbox | [sandbox-run-command.md](references/sandbox-run-command.md) | +| `base44 sandbox checkpoint` | Create a restore-point checkpoint of an app's remote sandbox | [sandbox-checkpoint.md](references/sandbox-checkpoint.md) | + ### Site Management | Command | Description | Reference | diff --git a/skills/base44-cli/references/connectors-initiate.md b/skills/base44-cli/references/connectors-initiate.md new file mode 100644 index 0000000..b33137e --- /dev/null +++ b/skills/base44-cli/references/connectors-initiate.md @@ -0,0 +1,63 @@ +# base44 connectors initiate + +Initialize a connector on an app and start its OAuth flow. Works without a local project directory when `--app-id` is provided. + +## Syntax + +```bash +npx base44 connectors initiate --integration-type [options] +``` + +## 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 | + +## Examples + +```bash +# Initiate Google Calendar connector on a specific app (no local project needed) +npx base44 connectors initiate --app-id app_123 --integration-type googlecalendar + +# With specific OAuth scopes (space-separated) +npx base44 connectors initiate --integration-type googlecalendar --scopes https://www.googleapis.com/auth/calendar + +# Multiple scopes, comma-separated +npx base44 connectors initiate --integration-type gmail --scopes scope.a,scope.b +``` + +## Behavior + +1. Sends an initiate request to Base44 for the specified integration type +2. If the connector is already authorized, reports so and suggests running `connectors pull` +3. If authorization is needed, provides a redirect URL for the OAuth flow: + - **Interactive mode**: Logs the URL, opens the browser, and polls until authorized + - **Non-interactive mode** (no TTY / `--app-id` only): Prints the URL and returns — open it manually to authorize + - **JSON mode** (`--json`): Returns the URL in structured output without opening a browser + +## JSON Mode Output (`--json`) + +```json +{ + "integrationType": "googlecalendar", + "alreadyAuthorized": false, + "redirectUrl": "https://auth.base44.io/oauth/...", + "connectionId": "conn_123" +} +``` + +After opening the redirect URL and completing the OAuth flow, run `npx base44 connectors pull` to fetch the connector config. + +## Notes + +- Does not require a local project directory — can be used with `--app-id` or `BASE44_APP_ID` +- Run `npx base44 connectors list-available` to see all supported integration types +- After successful authorization, run `npx base44 connectors pull` to sync config locally + +## Related Commands + +- [connectors-list-available.md](connectors-list-available.md) - List all available integration types +- [connectors-pull.md](connectors-pull.md) - Pull connectors from Base44 to local files +- [connectors-push.md](connectors-push.md) - Push local connectors to Base44 diff --git a/skills/base44-cli/references/connectors-pull.md b/skills/base44-cli/references/connectors-pull.md index 97502a5..e88cf62 100644 --- a/skills/base44-cli/references/connectors-pull.md +++ b/skills/base44-cli/references/connectors-pull.md @@ -5,9 +5,15 @@ Pull connector configurations from Base44 to local files. Replaces all local con ## Syntax ```bash -npx base44 connectors pull +npx base44 connectors pull [options] ``` +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--dir ` | Directory to write connector files to (default: `./connectors` when using `--app-id`) | No | + ## Authentication **Required**: Yes. If not authenticated, you'll be prompted to login first. @@ -15,14 +21,15 @@ npx base44 connectors pull ## What It Does 1. Fetches all connectors from Base44 -2. Writes connector files to the `base44/connectors/` directory +2. Writes connector files to the project's connectors directory 3. Deletes local connector files that don't exist remotely 4. Reports written and deleted connectors -## Prerequisites +## App Context -- Must be run from a Base44 project directory -- Project must be linked to a Base44 app +Works in two modes: +- **Linked project** (default): reads the connectors directory from `base44/config.jsonc` +- **App ID mode** (`--app-id` or `BASE44_APP_ID`): no local project required; writes to `./connectors` by default (override with `--dir`) ## Output @@ -68,8 +75,8 @@ 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` in the connectors directory +- When using a linked project, the directory location is configurable via `connectorsDir` in `config.jsonc` - 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..9da2d5c 100644 --- a/skills/base44-cli/references/connectors-push.md +++ b/skills/base44-cli/references/connectors-push.md @@ -5,9 +5,21 @@ 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 | + +## App Context + +Works in two modes: +- **Linked project** (default): reads connectors from the project's connectors directory (configured via `connectorsDir` in `config.jsonc`) +- **App ID mode** (`--app-id` or `BASE44_APP_ID`): no local project required; reads from `./connectors` by default (override with `--dir`) + ## What It Does 1. **Reads local connectors** from your `base44/connectors/` directory diff --git a/skills/base44-cli/references/sandbox-checkpoint.md b/skills/base44-cli/references/sandbox-checkpoint.md new file mode 100644 index 0000000..92f9cbe --- /dev/null +++ b/skills/base44-cli/references/sandbox-checkpoint.md @@ -0,0 +1,43 @@ +# 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 custom name +npx base44 sandbox checkpoint --name "before refactor" + +# On a specific app (no local project needed) +npx base44 sandbox checkpoint --app-id app_123 --name "stable state" +``` + +## JSON Output + +The command always returns JSON to stdout describing the created checkpoint. + +## Notes + +- Works from a linked project directory or with `--app-id` / `BASE44_APP_ID` +- Use checkpoints before large edits so you can restore to a known-good state + +## Related Commands + +- [sandbox-read-file.md](sandbox-read-file.md) - Read files from the sandbox +- [sandbox-write-file.md](sandbox-write-file.md) - Write files to the sandbox +- [sandbox-edit-file.md](sandbox-edit-file.md) - Edit files in the sandbox diff --git a/skills/base44-cli/references/sandbox-edit-file.md b/skills/base44-cli/references/sandbox-edit-file.md new file mode 100644 index 0000000..8e6e389 --- /dev/null +++ b/skills/base44-cli/references/sandbox-edit-file.md @@ -0,0 +1,63 @@ +# 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] +``` + +## Arguments + +| Argument | Description | Required | +|----------|-------------|----------| +| `` | File path relative to the app root | Yes | + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--edits-json ` | JSON array of edits. If omitted, reads from stdin | No | +| `--dry-run` | Return the unified diff without writing the file | No | + +## Edit Format + +Each edit is a JSON object: +```json +{ "old_text": "...", "new_text": "...", "replace_all": true } +``` + +- `old_text` — exact string to find (must be non-empty) +- `new_text` — replacement string (can be empty to delete) +- `replace_all` — optional boolean; if `true`, replaces all occurrences (default: first only) + +Pass as an array: `[{ "old_text": "foo", "new_text": "bar" }]` + +## Examples + +```bash +# Edit via piped stdin +echo '[{"old_text":"foo","new_text":"bar"}]' | npx base44 sandbox edit src/x.ts + +# Edit via flag +npx base44 sandbox edit src/x.ts --edits-json '[{"old_text":"a","new_text":"b","replace_all":true}]' + +# Dry run — see the diff without writing +npx base44 sandbox edit src/x.ts --dry-run --edits-json '[{"old_text":"a","new_text":"b"}]' +``` + +## JSON Output + +Returns a JSON object describing the applied edits or (with `--dry-run`) the unified diff. + +## Notes + +- Works from a linked project directory or with `--app-id` / `BASE44_APP_ID` +- If `--edits-json` is omitted and nothing is piped, the command throws an error + +## Related Commands + +- [sandbox-read-file.md](sandbox-read-file.md) - Read file contents from the sandbox +- [sandbox-write-file.md](sandbox-write-file.md) - Create or overwrite a file in the sandbox +- [sandbox-grep.md](sandbox-grep.md) - Search files in the sandbox diff --git a/skills/base44-cli/references/sandbox-grep.md b/skills/base44-cli/references/sandbox-grep.md new file mode 100644 index 0000000..e549887 --- /dev/null +++ b/skills/base44-cli/references/sandbox-grep.md @@ -0,0 +1,59 @@ +# 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 (default: case-insensitive) | 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 in all files +npx base44 sandbox grep "TODO" + +# Literal string search (not regex) +npx base44 sandbox grep "console.log(" --no-regex + +# Search only TypeScript files +npx base44 sandbox grep "useState" --glob "*.tsx" + +# Case-sensitive search in a specific directory +npx base44 sandbox grep "MyComponent" --path src/components --case-sensitive + +# Limit to 20 results +npx base44 sandbox grep "import" --max-results 20 +``` + +## JSON Output + +Returns a JSON object with match lines, file paths, and line numbers. + +## Notes + +- Works from a linked project directory or with `--app-id` / `BASE44_APP_ID` +- Pattern is treated as a regex by default; use `--no-regex` for literal searches + +## Related Commands + +- [sandbox-read-file.md](sandbox-read-file.md) - Read a specific file's contents +- [sandbox-list-directory.md](sandbox-list-directory.md) - List directory entries +- [sandbox-edit-file.md](sandbox-edit-file.md) - Edit files in the sandbox diff --git a/skills/base44-cli/references/sandbox-list-directory.md b/skills/base44-cli/references/sandbox-list-directory.md new file mode 100644 index 0000000..79e08f5 --- /dev/null +++ b/skills/base44-cli/references/sandbox-list-directory.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 a specific directory +npx base44 sandbox ls src/components + +# Recursive listing with max depth +npx base44 sandbox ls --recursive --max-depth 2 + +# Include hidden files (dotfiles) +npx base44 sandbox ls --include-hidden + +# On a specific app (no local project needed) +npx base44 sandbox ls --app-id app_123 src +``` + +## JSON Output + +Returns a JSON object listing file and directory entries with metadata (name, type, size, etc.). + +## Notes + +- Works from a linked project directory or with `--app-id` / `BASE44_APP_ID` +- When `--recursive` is omitted, only the immediate children of `[path]` are listed + +## Related Commands + +- [sandbox-read-file.md](sandbox-read-file.md) - Read file contents from the sandbox +- [sandbox-grep.md](sandbox-grep.md) - Search files in the sandbox +- [sandbox-write-file.md](sandbox-write-file.md) - Write a file to the sandbox diff --git a/skills/base44-cli/references/sandbox-read-file.md b/skills/base44-cli/references/sandbox-read-file.md new file mode 100644 index 0000000..1a974ac --- /dev/null +++ b/skills/base44-cli/references/sandbox-read-file.md @@ -0,0 +1,53 @@ +# 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 at once +npx base44 sandbox read src/index.ts src/utils.ts + +# Read lines 10–30 of a file +npx base44 sandbox read src/index.ts --offset 10 --limit 20 + +# On a specific app (no local project needed) +npx base44 sandbox read --app-id app_123 package.json +``` + +## JSON Output + +Returns a JSON object with the file content(s) and metadata. + +## Notes + +- Works from a linked project directory or with `--app-id` / `BASE44_APP_ID` +- `--offset` and `--limit` use 1-based line numbers, matching common editor conventions + +## Related Commands + +- [sandbox-write-file.md](sandbox-write-file.md) - Write or overwrite a file +- [sandbox-edit-file.md](sandbox-edit-file.md) - Apply exact edits to a file +- [sandbox-list-directory.md](sandbox-list-directory.md) - List directory contents diff --git a/skills/base44-cli/references/sandbox-run-command.md b/skills/base44-cli/references/sandbox-run-command.md new file mode 100644 index 0000000..e8a0556 --- /dev/null +++ b/skills/base44-cli/references/sandbox-run-command.md @@ -0,0 +1,59 @@ +# 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 a single string) | 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" + +# List files with arguments +npx base44 sandbox run ls -la --cwd src + +# Run a script with a custom timeout +npx base44 sandbox run "node scripts/migrate.js" --timeout-ms 300000 + +# On a specific app (no local project needed) +npx base44 sandbox run --app-id app_123 "npm install" +``` + +## JSON Output + +Returns a JSON object with: +- `stdout` — captured output from the command +- `stderr` — captured error output +- `exitCode` — the remote command's exit code + +The CLI itself exits `0` regardless of the remote command's exit code — the exit code is reported in the JSON output. + +## Notes + +- Works from a linked project directory or with `--app-id` / `BASE44_APP_ID` +- The command runs inside the app's server-side sandbox environment +- Default timeout is 2 minutes (120000 ms); max is 10 minutes (600000 ms) + +## Related Commands + +- [sandbox-read-file.md](sandbox-read-file.md) - Read files from the sandbox +- [sandbox-write-file.md](sandbox-write-file.md) - Write files to the sandbox +- [sandbox-checkpoint.md](sandbox-checkpoint.md) - Create a restore-point checkpoint diff --git a/skills/base44-cli/references/sandbox-write-file.md b/skills/base44-cli/references/sandbox-write-file.md new file mode 100644 index 0000000..cb14d5e --- /dev/null +++ b/skills/base44-cli/references/sandbox-write-file.md @@ -0,0 +1,55 @@ +# base44 sandbox write + +Create or overwrite a file in an app's remote sandbox. + +## Syntax + +```bash +npx base44 sandbox write [options] +``` + +## Arguments + +| Argument | Description | Required | +|----------|-------------|----------| +| `` | File path relative to the app root | Yes | + +## Options + +| Option | Description | Required | +|--------|-------------|----------| +| `--content ` | File content (if omitted, reads from stdin) | No | +| `--overwrite` | Overwrite the file if it already exists | No | + +## Examples + +```bash +# Write content from stdin +echo "hello world" | npx base44 sandbox write notes.txt + +# Write content via flag (overwrites if exists) +npx base44 sandbox write notes.txt --content "hello" --overwrite + +# Write a multi-line file from a local file +cat local-file.ts | npx base44 sandbox write src/remote-file.ts --overwrite + +# On a specific app (no local project needed) +npx base44 sandbox write --app-id app_123 config.json --content "{}" --overwrite +``` + +## JSON Output + +Returns a JSON object describing the written file (path, size, etc.). + +## Notes + +- Works from a linked project directory or with `--app-id` / `BASE44_APP_ID` +- If `--content` is omitted and nothing is piped, the command throws an error +- File content from stdin is preserved verbatim (trailing newlines are not stripped) +- Without `--overwrite`, writing to an existing file will fail + +## Related Commands + +- [sandbox-read-file.md](sandbox-read-file.md) - Read file contents from the sandbox +- [sandbox-edit-file.md](sandbox-edit-file.md) - Apply targeted edits to a file (preserves unchanged content) +- [sandbox-checkpoint.md](sandbox-checkpoint.md) - Create a restore-point before making changes diff --git a/skills/base44-troubleshooter/SKILL.md b/skills/base44-troubleshooter/SKILL.md index 60a346f..4712d4c 100644 --- a/skills/base44-troubleshooter/SKILL.md +++ b/skills/base44-troubleshooter/SKILL.md @@ -57,10 +57,20 @@ 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. `--since` and `--until` accept ISO datetimes or relative shorthands (`1h`, `30m`, `2d`): ```bash npx base44 logs --function --since --until + +# Relative shorthand examples +npx base44 logs --since 1h +npx base44 logs --function --since 2h --until 1h +``` + +To fetch production logs (published app) instead of preview (draft): + +```bash +npx base44 logs --env prod --level error ``` ### 4. Analyze the Logs diff --git a/skills/base44-troubleshooter/references/project-logs.md b/skills/base44-troubleshooter/references/project-logs.md index 6b14b1d..40b45cb 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 | +| `--env ` | Which deployment to read logs from: `preview` (current draft) or `prod` (published). Default: `preview` | No | ## Examples @@ -39,9 +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 since a specific time (ISO datetime) npx base44 logs --since 2024-01-15T10:00:00 +# Fetch logs using relative time shorthand +npx base44 logs --since 1h +npx base44 logs --since 30m --until 10m + # Fetch logs within a time range npx base44 logs --since 2024-01-15T10:00:00 --until 2024-01-15T12:00:00 @@ -50,6 +55,12 @@ npx base44 logs -n 100 --order asc # Last 10 errors for a specific function npx base44 logs --function myFunction --level error --limit 10 + +# Fetch production logs (published app) +npx base44 logs --env prod + +# Fetch preview logs (current draft, default) +npx base44 logs --env preview ``` ## Notes @@ -59,4 +70,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 datetimes or relative shorthands like `1h`, `30m`, `2d`. ISO values without a timezone are normalized to UTC (appends `Z`). +- `--env preview` shows logs from the current draft (default); `--env prod` shows logs from the published version.