Skip to content

feat(cli): add logs command for gateway log access - #1105

Merged
ilblackdragon merged 1 commit into
nearai:stagingfrom
reidliu41:feat/logs-cli
Mar 15, 2026
Merged

ilblackdragon merged 1 commit into
nearai:stagingfrom
reidliu41:feat/logs-cli

Conversation

@reidliu41

Copy link
Copy Markdown
Contributor

Summary

  • Add ironclaw logs to tail gateway.log with reverse-seek (O(output) memory, no full-file load)
  • Add --follow for live SSE streaming from /api/logs/events
  • Add --level to get/set runtime log level via /api/logs/level
  • Support --json, --plain, --local-time, --url, --token, --timeout flags
  • Respect --config for gateway address/token resolution (consistent with other CLI commands)
  • Fail explicitly when --config points to invalid file instead of silent fallback
  • Wire Logs variant into Command enum and main.rs dispatch
  • Add 9 unit tests (tail_file chunked read, colorize, timestamp conversion, JSON output)
  • Update FEATURE_PARITY.md: logs ❌ → 🚧

Change Type

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • CI/Infrastructure
  • Security
  • Dependencies

Linked Issue

part of #83

Validation

  • cargo fmt
  • cargo clippy --all --benches --tests --examples --all-features
  • Relevant tests pass:
  • Manual testing:

Security Impact

Database Impact

Blast Radius

Rollback Plan


Review track:

  - Add `ironclaw logs` to tail gateway.log with reverse-seek (O(output) memory, no full-file load)
  - Add `--follow` for live SSE streaming from /api/logs/events
  - Add `--level` to get/set runtime log level via /api/logs/level
  - Support --json, --plain, --local-time, --url, --token, --timeout flags
  - Respect --config for gateway address/token resolution (consistent with other CLI commands)
  - Fail explicitly when --config points to invalid file instead of silent fallback
  - Wire Logs variant into Command enum and main.rs dispatch
  - Add 9 unit tests (tail_file chunked read, colorize, timestamp conversion, JSON output)
  - Update FEATURE_PARITY.md: logs ❌ → 🚧
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot added scope: channel/cli TUI / CLI channel scope: docs Documentation size: XL 500+ changed lines risk: low Changes to docs, tests, or low-risk modules contributor: experienced 6-19 merged PRs labels Mar 13, 2026

@zmanian zmanian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-structured CLI command. The tail_file reverse-seek implementation is correct and efficient. Good error messages with actionable hints. Minor nit: the SSE timeout value (u64::MAX / 2) is a bit ugly -- Duration::MAX or omitting the timeout entirely would be cleaner. Not blocking. LGTM.

@reidliu41

Copy link
Copy Markdown
Contributor Author

This PR is approved and CI is green — could you help merge it? Thanks!

@ilblackdragon
ilblackdragon merged commit 67b2c08 into nearai:staging Mar 15, 2026
13 checks passed
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
- Add `ironclaw logs` to tail gateway.log with reverse-seek (O(output) memory, no full-file load)
  - Add `--follow` for live SSE streaming from /api/logs/events
  - Add `--level` to get/set runtime log level via /api/logs/level
  - Support --json, --plain, --local-time, --url, --token, --timeout flags
  - Respect --config for gateway address/token resolution (consistent with other CLI commands)
  - Fail explicitly when --config points to invalid file instead of silent fallback
  - Wire Logs variant into Command enum and main.rs dispatch
  - Add 9 unit tests (tail_file chunked read, colorize, timestamp conversion, JSON output)
  - Update FEATURE_PARITY.md: logs ❌ → 🚧
drchirag1991 pushed a commit to drchirag1991/ironclaw that referenced this pull request Apr 8, 2026
- Add `ironclaw logs` to tail gateway.log with reverse-seek (O(output) memory, no full-file load)
  - Add `--follow` for live SSE streaming from /api/logs/events
  - Add `--level` to get/set runtime log level via /api/logs/level
  - Support --json, --plain, --local-time, --url, --token, --timeout flags
  - Respect --config for gateway address/token resolution (consistent with other CLI commands)
  - Fail explicitly when --config points to invalid file instead of silent fallback
  - Wire Logs variant into Command enum and main.rs dispatch
  - Add 9 unit tests (tail_file chunked read, colorize, timestamp conversion, JSON output)
  - Update FEATURE_PARITY.md: logs ❌ → 🚧
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: experienced 6-19 merged PRs risk: low Changes to docs, tests, or low-risk modules scope: channel/cli TUI / CLI channel scope: docs Documentation size: XL 500+ changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants