Rahil Pirani

Tips and tricks: how are you using the REST API or CLI?

I've noticed more people using second-brain in ways I didn't expect when I created it, and I want to record that somewhere.

This thread is for sharing how you actually use the REST API or CLI in your daily routines. I’m not looking for the obvious tips from the README, but rather the workflows you've created, the scripts you're running, and the things that turned out to be more helpful than you thought.

I'll start:

REST API

`GET /recall` is the one I frequently use in scripts. It performs the same semantic search as the MCP tool, so you get meaning-based results without needing an MCP client set up. I use it to gather relevant information before running an automated task, which keeps the LLM call focused instead of relying on a cold start.

CLI

I have a GitHub Action that activates every time a PR merges. It captures the PR title, description, author, and commit messages directly into second-brain using brain remember. There's no manual effort needed. The project's development history builds up automatically in memory.

Here's the workflow file if you want to adapt it for your own repo

What are you doing with it? It doesn't have to be complex. Even a simple one-liner that saves you time is worth sharing.

47 views

Add a comment

Replies

Best
Emmett Charles

@rahilpirani Have you run into any limits or bottlenecks using the REST API?

Rahil Pirani
@emmett_charles Honestly, not yet and I’ve been using it heavily for about six weeks. I was expecting to hit Vectorize query limits or D1 CPU constraints at some point, but neither has been a real issue in practice. The Cloudflare free tier has been more generous than I expected for this use case. If you’re building something at serious scale that’s a different conversation, but for daily personal use it’s held up without friction.
Nathaniel George

What's one unexpected benefit you've found from automating with the CLI?

Rahil Pirani
@nathaniel_george The one I didn’t see coming: I stopped opening Notion, Slack, or my notes app to remember what I was doing. I just run brain recall "what was I working on with the auth flow" straight from the terminal and get a real answer. Everything I’ve captured through automation is now queryable without leaving my workflow.