| name | fieldtheory-cli-bookmarks |
| description | Sync, search, classify, and query X/Twitter bookmarks locally using the Field Theory CLI |
| triggers | ["sync my Twitter bookmarks","search my X bookmarks","classify my bookmarks","set up fieldtheory cli","ft sync bookmarks","download all my X bookmarks locally","use bookmarks with Claude Code agent","schedule bookmark sync"] |
Field Theory CLI — X/Twitter Bookmark Manager
Skill by ara.so — Daily 2026 Skills collection.
Field Theory CLI (ft) syncs all your X/Twitter bookmarks locally, indexes them for full-text search, classifies them by category and domain, and exposes them to AI agents via shell commands. No official API required for the default sync mode.
Installation
npm install -g fieldtheory
Requirements:
- Node.js 20+
- Google Chrome (logged into X/Twitter) for default sync mode
- macOS for Chrome session sync; Linux/Windows use OAuth mode
Verify installation:
ft --version
ft status
Quick Start
ft sync
ft search "machine learning"
ft viz
Data is stored at ~/.ft-bookmarks/ by default.
Core Commands
Syncing
ft sync
ft sync --classify
ft sync --full
ft sync --api
ft status
Searching
ft search "distributed systems"
ft search "rust async runtime"
ft search "cancer immunotherapy"
ft list --author elonmusk
ft list --category tool
ft list --domain ai
ft list --since 2024-01-01
ft list --category research --domain biology
ft show 1234567890
Classification
ft classify
ft classify --regex
ft index
Exploration & Stats
ft viz
ft categories
ft domains
ft stats
ft path
Media
ft fetch-media
OAuth Setup (Cross-Platform / API Mode)
ft auth
ft sync --api
OAuth token stored at ~/.ft-bookmarks/oauth-token.json with chmod 600.
Configuration
Custom Data Directory
export FT_DATA_DIR=/path/to/custom/dir
FT_DATA_DIR=/Volumes/external/bookmarks ft sync
Data File Layout
~/.ft-bookmarks/
bookmarks.jsonl # raw bookmarks, one JSON object per line
bookmarks.db # SQLite FTS5 search index
bookmarks-meta.json # sync cursor and metadata
oauth-token.json # OAuth credentials (API mode only)
Scheduling Sync
Add to crontab (crontab -e):
0 7 * * * ft sync
0 7 * * * ft sync --classify
0 0 * * 0 ft sync --full
Categories Reference
| Category | Description |
|---|
tool | GitHub repos, CLI tools, npm packages, open-source |
security | CVEs, vulnerabilities, exploits, supply chain |
technique | Tutorials, demos, code patterns, how-to threads |
launch | Product launches, announcements, "just shipped" |
research | ArXiv papers, studies, academic findings |
opinion | Takes, analysis, commentary, threads |
commerce | Products, shopping, physical goods |
Working with Bookmark Data (TypeScript/Node.js)
The bookmarks.jsonl file can be consumed directly in scripts:
import { createReadStream } from "fs";
import { createInterface } from "readline";
import { homedir } from "os";
import { join } from "path";
interface Bookmark {
id: string;
text: string;
author: string;
created_at: string;
url: string;
category?: string;
domain?: string;
media?: string[];
}
async function loadBookmarks(): Promise<Bookmark[]> {
const dataDir = process.env.FT_DATA_DIR ?? join(homedir(), ".ft-bookmarks");
const filePath = join(dataDir, "bookmarks.jsonl");
const bookmarks: Bookmark[] = [];
const rl = createInterface({
input: createReadStream(filePath),
: ,
});
( line rl) {
(line.()) {
bookmarks.(.(line));
}
}
bookmarks;
}
bookmarks = ();
tools = bookmarks.( b. === );
.();
Query SQLite Index Directly
import Database from "better-sqlite3";
import { join } from "path";
import { homedir } from "os";
const dataDir = process.env.FT_DATA_DIR ?? join(homedir(), ".ft-bookmarks");
const db = new Database(join(dataDir, "bookmarks.db"), { readonly: true });
function searchBookmarks(query: string, limit = 20) {
const stmt = db.prepare(`
SELECT id, text, author, created_at, category, domain
FROM bookmarks
WHERE bookmarks MATCH ?
ORDER BY rank
LIMIT ?
`);
return stmt.all(query, limit);
}
function getByCategory(category: string) {
const stmt = db.prepare(`
SELECT * FROM bookmarks WHERE category = ? ORDER BY created_at DESC
`);
return stmt.all(category);
}
const results = searchBookmarks();
.(results);
Shell Integration in Agent Scripts
import { execSync } from "child_process";
function ftSearch(query: string): string {
return execSync(`ft search "${query}"`, { encoding: "utf8" });
}
function ftList(options: { category?: string; since?: string; author?: string }) {
const flags = [
options.category ? `--category ${options.category}` : "",
options.since ? `--since ${options.since}` : "",
options.author ? `--author ${options.author}` : "",
]
.filter(Boolean)
.join(" ");
return execSync(`ft list ${flags}`, { encoding: "utf8" });
}
const memoryTools = ftSearch("AI memory");
const recentTools = ftList({ : , : });
Agent Integration Patterns
Tell your AI agent to use ft directly in natural language:
"Search my bookmarks for distributed tracing tools and summarize the top 5."
"Sync any new X bookmarks, then list all research papers from 2025."
"Find everything I've bookmarked about Rust and categorize it by subtopic."
"Every morning, run ft sync --classify to keep my bookmarks up to date."
Claude Code example prompt:
Use the `ft` CLI to search my bookmarks for "vector database"
and pick the best open-source option to add to this project.
Run: ft search "vector database" --category tool
Troubleshooting
Chrome session not found
ft sync
ft auth
ft sync --api
Sync stalls or returns 0 bookmarks
ft status
ft sync --full
ls -la ~/.ft-bookmarks/
Search returns no results
ft index
ft stats
wc -l ~/.ft-bookmarks/bookmarks.jsonl
Classification not running
ft classify --regex
ft sync --classify --regex
Reset all data
rm -rf ~/.ft-bookmarks
ft sync
Custom data directory issues
echo $FT_DATA_DIR
ft path
mkdir -p "$FT_DATA_DIR"
chmod 755 "$FT_DATA_DIR"
Security Notes
- All data is local only — no telemetry or external calls except to X during sync
- Chrome cookies are read temporarily for sync and never stored separately
- OAuth token is stored
chmod 600 — treat it like a password
- Default sync uses X's internal GraphQL API (same as browser);
--api uses official v2 API
Platform Support
| Feature | macOS | Linux | Windows |
|---|
ft sync (Chrome session) | ✅ | ❌ | ❌ |
ft sync --api (OAuth) | ✅ | ✅ | ✅ |
| Search, classify, viz | ✅ | ✅ | ✅ |
Linux/Windows users must run ft auth first, then use ft sync --api.
Resources