Chuyển đến nội dung
Skillpedia
Lập trình chung58k · #3231

cli-anything-nslogger

Skill này làm gì

Skill này giúp agent AI mở các file log NSLogger và lấy ra những thông điệp quan trọng. Skill dành cho lập trình viên ứng dụng cần tìm lỗi trong ứng dụng iOS hoặc macOS.

Khi nào nên dùng

  • ✓Khi bạn chỉ muốn xem các lỗi trong một log được ghi lại lúc ứng dụng bị crash.
  • ✓Khi bạn cần tìm trong log một từ hoặc mẫu cụ thể.
  • ✓Khi bạn muốn xuất log ra văn bản, JSON hoặc CSV để chia sẻ.

Liên kết skill

https://github.com/HKUDS/CLI-Anything/blob/main/nslogger/agent-harness/cli_anything/nslogger/skills/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/HKUDS/CLI-Anything/blob/main/nslogger/agent-harness/cli_anything/nslogger/skills/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn chỉ xem các lỗi mạng trong file NSLogger này, kèm theo thời gian của chúng.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đọc file log và áp dụng bộ lọc theo mức độ, thẻ, luồng hoặc nội dung cần tìm. Sau đó agent in ra các kết quả khớp hoặc lưu chúng theo định dạng bạn chọn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

cli-anything-nslogger

A complete CLI harness for NSLogger, the macOS log viewer for iOS/macOS apps.

Installation

cd nslogger/agent-harness
pip install -e .
# Verify
cli-anything-nslogger --help

Command Reference

generate — Create sample files for testing

cli-anything-nslogger generate sample.rawnsloggerdata --count 50

read — Display messages from a file

# All messages
cli-anything-nslogger read session.rawnsloggerdata

# Errors only (level 0)
cli-anything-nslogger read session.rawnsloggerdata --level 0

# Filter by tag and text search
cli-anything-nslogger read session.rawnsloggerdata --tag Network --search "timeout"

# First 20 messages as JSON
cli-anything-nslogger read session.rawnsloggerdata --limit 20 --json

filter — Advanced filtering

# Errors and warnings only
cli-anything-nslogger filter session.rawnsloggerdata --level 1

# By tag
cli-anything-nslogger filter session.rawnsloggerdata --tag Auth --tag Network

# Regex search
cli-anything-nslogger filter session.rawnsloggerdata --regex "(timeout|failed|error)"

# By thread
cli-anything-nslogger filter session.rawnsloggerdata --thread "main"

# JSON output
cli-anything-nslogger filter session.rawnsloggerdata --level 0 --json

export — Export to text/JSON/CSV

# JSON to stdout
cli-anything-nslogger export session.rawnsloggerdata --format json

# CSV to file
cli-anything-nslogger export session.rawnsloggerdata --format csv --output logs.csv

# Filtered text export
cli-anything-nslogger export session.rawnsloggerdata --format text --level 1 --tag Network

stats — Summary statistics

# Human-readable summary
cli-anything-nslogger stats session.rawnsloggerdata

# JSON for agent consumption
cli-anything-nslogger stats session.rawnsloggerdata --json

JSON output shape:

{
  "total": 342,
  "by_level": {"ERROR": 12, "WARNING": 34, "INFO": 200, "DEBUG": 96},
  "by_tag": {"Network": 89, "Auth": 45, "UI": 120},
  "by_thread": {"main": 200, "bg-queue": 142},
  "by_type": {"text": 340, "client_info": 1, "disconnect": 1},
  "clients": ["MyApp"],
  "first_timestamp": "2024-01-01T10:00:00+00:00",
  "last_timestamp": "2024-01-01T10:05:30+00:00",
  "duration_seconds": 330.0
}

listen — Receive live connections

# Match the NSLogger.app GUI Bonjour behavior for iOS auto-discovery
cli-anything-nslogger listen --bonjour --name bazinga --debug

# Mirror live logs to a text file while still printing stdout
cli-anything-nslogger listen --bonjour --name bazinga --output app.log

# Write machine-readable JSON Lines
cli-anything-nslogger listen --bonjour --name bazinga --output app.jsonl --output-format jsonl

# Direct TCP/TLS mode for manually configured clients
cli-anything-nslogger listen --port 50000 --ssl --debug

# Show only errors while listening, output as JSON stream
cli-anything-nslogger listen --bonjour --name bazinga --level 0 --json

# Run until Ctrl-C
cli-anything-nslogger listen --bonjour --name bazinga

Use Bonjour mode first for iOS apps because it matches the desktop NSLogger GUI: the CLI publishes a native macOS NetService with _nslogger-ssl._tcp and accepts TLS NSLogger frames. Use direct TCP/TLS only when the app is manually configured with the Mac host and port.

repl — Interactive Command REPL

cli-anything-nslogger repl session.rawnsloggerdata
# Or launch it by running cli-anything-nslogger with no subcommand.

Log Levels

Value Name Use for
0 ERROR Unrecoverable failures
1 WARNING Recoverable issues
2 INFO Normal operation
3 DEBUG Developer details
4 VERBOSE Trace-level noise

Message JSON Shape

{
  "sequence": 42,
  "timestamp": "2024-01-01T10:01:23+00:00",
  "timestamp_ms": 456,
  "thread_id": "main",
  "tag": "Network",
  "level": 0,
  "level_name": "ERROR",
  "type": "text",
  "text": "Connection timed out after 30s",
  "image_width": 0,
  "image_height": 0,
  "client_name": "MyApp",
  "client_version": "2.1.0",
  "os_name": "iOS",
  "os_version": "17.0",
  "machine": "iPhone15,2"
}

Agent Workflow Examples

# 1. Inspect a captured crash session
cli-anything-nslogger stats crash.rawnsloggerdata --json

# 2. Find all errors in the 5 minutes before crash
cli-anything-nslogger filter crash.rawnsloggerdata --level 0 --json
Câu hỏi thường gặp

Skill đọc những loại file nào?

Skill đọc các file dữ liệu NSLogger có đuôi rawnsloggerdata hoặc nsloggerdata.

Nó có thể tạo log mẫu để thử nghiệm không?

Có. Lệnh generate tạo các file mẫu để bạn dùng thử công cụ.

Nó có thể theo dõi log trong lúc ứng dụng chạy không?

Mô tả có nhắc đến việc theo dõi, nên skill có thể để mắt tới log và báo các mục mới.

Chi tiết

Mô tả gốc của tác giả

CLI harness for NSLogger — parse, filter, export, and monitor NSLogger log files (.rawnsloggerdata / .nsloggerdata)

repo: HKUDS/CLI-Anything

Độ phổ biến

Sao GitHub
58k
Vị trí xếp hạng
#3231
Giấy phép
Apache-2.0
Cập nhật
21/9/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự