Run your first agent session
Three commands and a tap on your phone — that's the whole loop.
Three commands and a tap on your phone — that's the whole loop.
This walkthrough assumes you've already installed NightMe and connected Feishu. If you have, the rest of this post takes about 90 seconds to follow along.
Step 1 — Start the daemon
nightme start
By default the daemon writes its PID to ~/.nightme/nightme.pid and logs to ~/.nightme/nightme.log. Add -d to fork into the background, or -f to keep it attached to the current terminal (handy while you're poking at config).
To make the daemon survive reboots, install it as a service — see the service install addendum below.
Step 2 — Open a chat with the bot
In Feishu, search for the NightMe bot and send any message — hello, a screenshot, a code snippet, anything. The bot replies with a status card that includes four fields:
| Field | What it tells you |
|---|---|
| CWD | The working directory the bot is currently scoped to (per-chat). |
| Git | clean / dirty / branch name — derived from git status -sb. |
| Agent | Which CLI agent is loaded in this chat (claude, codex, pi, none). |
| Token | Tokens used in this chat, this calendar month. |
That status card is what you'll glance at on your phone — it's the "is the AI doing the right thing in the right place" signal.
Step 3 — Pick an agent and give it a task
/use claude
Refactor the parser in src/parser.rs to use nom instead of hand-rolled code.
/use is a session-scoped command — it switches the agent for this chat only. Other chats keep their own agent (or none). The bot confirms the switch by replying with the new agent name and the CWD.
Now type the actual task. NightMe forwards the message to the local Claude Code process bound to this chat; the agent starts streaming logs back as a Feishu card. You'll see tool calls (Read src/parser.rs, Bash cargo check) update in real time.
Step 4 — Steer, stop, and resume from your phone
While the agent is running:
/steer <message>— appends a message to the agent's queue. The current tool finishes; the new instruction runs next./stop— cancels the in-flight tool (aSIGINT-equivalent) and parks the session. Send/resumeto continue./diff— prints the agent's working-tree diff as a Feishu card with line counts and file list.
That's the loop. The terminal on your desk can stay closed. The bot is the dashboard.
A more realistic session
You → /use claude
You → /cwd ~/code/ntme-driver
Bot → Agent set to claude. CWD: ~/code/ntme-driver.
You → Fix the bug where the daemon crashes on Windows when the config
file has CRLF line endings. Add a test that fails on the bug.
Claude → Read cmd/nightme/config.go
→ Bash go test ./... -run TestConfigCRLF
→ Edit cmd/nightme/config.go
→ Bash go test ./... -run TestConfigCRLF
→ Done. Test added; bug fixed in cmd/nightme/config.go:48.
You → /diff
Bot → 1 file changed
• cmd/nightme/config.go +12 −4
The /diff reply links straight to the patch in your terminal — tap it, glance at the hunks, reply lgtm, push (or whatever your team workflow is) without ever opening the laptop.
Running as a service
Once you're happy with the loop, persist the daemon across reboots so the bot is reachable even when no shell is open.
# macOS — writes a LaunchAgent plist to ~/Library/LaunchAgents
nightme service install --user
# Linux — writes a systemd --user unit
nightme service install --user
# Windows — registers a per-user Scheduled Task
nightme service install --user
nightme service status reports the current state. nightme service uninstall removes it. All three modes run the daemon as the current user, so ~/.nightme/auth/*.json keeps working without permission juggling.
What's next
- Multiple agents in parallel — open three chats,
/use claudein each, drop one task per chat. See Run agents in parallel. - One-shot Git worktrees —
/gtw fix -n branchopens a fresh worktree and runs a single agent there. See Use /gtw for one-shot fixes. - Troubleshooting — when something doesn't behave,
nightme doctoris the first call.