Install
openclaw skills install tilCapture and manage TIL (Today I Learned) entries on OpenTIL. Use /til <content> to capture, /til to extract insights from conversation, or /til list|publish|edit|search|delete|status|sync|tags|categories|batch to manage entries -- all without leaving the CLI.
openclaw skills install tilCapture and manage "Today I Learned" entries on OpenTIL -- from drafting to publishing, all within the CLI.
read:entries, write:entries, and delete:entries scopestil_)export OPENTIL_TOKEN="til_xxx"
Token resolution order:
$OPENTIL_TOKEN environment variable (overrides all profiles)~/.til/credentials file — active profile's token (created by /til auth)If neither is set, entries are saved locally to ~/.til/drafts/.
~/.til/credentials stores named profiles in YAML:
active: personal
profiles:
personal:
token: til_abc...
nickname: hong
site_url: https://opentil.ai/@hong
host: https://opentil.ai
work:
token: til_xyz...
nickname: hong-corp
site_url: https://opentil.ai/@hong-corp
host: https://opentil.ai
active: name of the currently active profileprofiles: map of profile name → credentialstoken, nickname (from API), site_url, hostBackward compatibility: If ~/.til/credentials contains a plain text token (old format), silently migrate it to a default profile in YAML format and write back.
The first word after /til determines the action. Reserved words route to management subcommands; anything else is treated as content to capture.
| Invocation | Action |
|---|---|
/til list [drafts|published|all] | List entries (default: drafts) |
/til publish [<id> | last] | Publish an entry |
/til unpublish <id> | Unpublish (revert to draft) |
/til edit <id> [instructions] | AI-assisted edit |
/til search <keyword> | Search entries by title |
/til delete <id> | Delete entry (with confirmation) |
/til status | Show site status and connection info |
/til sync | Sync local drafts to OpenTIL |
/til tags | List site tags with usage counts |
/til categories | List site categories |
/til batch <topics> | Batch-capture multiple TIL entries |
/til auth | Connect OpenTIL account (browser auth) |
/til auth switch [name] | Switch active profile (by profile name or @nickname) |
/til auth list | List all profiles |
/til auth remove <name> | Remove a profile |
/til auth rename <old> <new> | Rename a profile |
/til <anything else> | Capture content as a new TIL |
/til | Extract insights from conversation (multi-candidate) |
Reserved words: list, publish, unpublish, edit, search, delete, status, sync, tags, categories, batch, auth.
⚠️ DO NOT read reference files unless specified below. SKILL.md contains enough inline context for most operations.
| Subcommand | References to load |
|---|---|
/til <content> | none |
/til (extract from conversation) | none |
/til list|status|tags|categories | references/management.md |
/til publish|unpublish|edit|search|delete|batch | references/management.md |
/til sync | references/management.md, references/local-drafts.md |
/til auth | references/management.md, references/api.md |
/til auth switch|list|remove|rename | references/management.md |
| Trigger | Reference to load |
|---|---|
| API returns non-2xx after inline error handling is insufficient | references/api.md |
| Auto-detection context (proactive TIL suggestion) | references/auto-detection.md |
| No token found (first-run local fallback) | references/local-drafts.md |
Create and publish an entry:
curl -X POST "https://opentil.ai/api/v1/entries" \
-H "Authorization: Bearer $OPENTIL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"entry": {
"title": "Go interfaces are satisfied implicitly",
"content": "In Go, a type implements an interface...",
"summary": "Go types implement interfaces implicitly by implementing their methods, with no explicit declaration needed.",
"tag_names": ["go", "interfaces"],
"published": true,
"lang": "en"
}
}'
Key create parameters:
| Field | Type | Required | Description |
|---|---|---|---|
content | string | yes | Markdown body (max 100,000 chars) |
title | string | no | Entry title (max 200 chars). Auto-generates slug. |
tag_names | array | no | 1-3 lowercase tags, e.g. ["go", "concurrency"] |
published | boolean | no | false for draft (default), true to publish immediately |
lang | string | no | Language code: en, zh-CN, zh-TW, ja, ko, etc. |
slug | string | no | Custom URL slug. Auto-generated from title if omitted. |
visibility | string | no | public (default), unlisted, or private |
summary | string | no | AI-generated summary for listing pages (max 500 chars) |
Management endpoints:
| Endpoint | Method | Description |
|---|---|---|
/entries?status=draft&q=keyword | GET | List/search entries |
/entries/:id | GET | Get a single entry |
/entries/:id | PATCH | Update entry fields |
/entries/:id | DELETE | Permanently delete entry |
/entries/:id/publish | POST | Publish a draft |
/entries/:id/unpublish | POST | Revert to draft |
/site | GET | Site info (username, entry counts, etc.) |
/tags?sort=popular | GET | List tags with usage counts |
/categories | GET | List categories with entry counts |
Full parameter list, response format, and error handling: see references/api.md
Every /til invocation follows this flow:
~/.til/credentials)
~/.til/credentials exists in old plain-text format, migrate to YAML default profile firstpublished: true -> show published URL~/.til/drafts/ -> show first-run guide with connect prompt~/.til/credentials (active profile) or no prior token: prompt to reconnect via device flow → on success, update the active profile's token and auto-retry the original operation$OPENTIL_TOKEN env var: cannot auto-fix — guide user to update/unset the variableAccount: @nickname (profile_name) in result messages so the user always knows which account was used/til <content> -- Explicit CaptureThe user's input is raw material -- a seed, not the final entry. Generate a complete TIL from it:
Steps:
rails, postgresql, go)lang (en, zh-CN, zh-TW, ja, ko, es, fr, de, pt-BR, pt, ru, ar, bs, da, nb, pl, th, tr, it)No confirmation needed -- the user explicitly asked to capture. Execute directly.
/til -- Extract from ConversationWhen /til is used without arguments, analyze the current conversation for learnable insights.
Steps:
0 insights:
No clear TIL insights found in this conversation.
1 insight: Generate the full draft (title, body, tags), show it, ask for confirmation. On confirmation -> follow Execution Flow.
2+ insights: Show a numbered list (max 5), let the user choose:
Found 3 TIL-worthy insights:
1. Go interfaces are satisfied implicitly
2. PostgreSQL JSONB arrays don't support GIN @>
3. CSS :has() enables parent selection
Which to capture? (1/2/3/all/none)
1,3) -> generate drafts for selected, show all for confirmation, POST sequentiallyall -> generate drafts for each, show all for confirmation, POST sequentiallynone -> cancelWhen working alongside a user, proactively detect moments worth capturing as TIL entries.
Suggest when the conversation produces a genuine "aha" moment — something surprising, non-obvious, or worth remembering. Examples:
Do NOT suggest for: standard tool usage, documented behavior, typo-caused bugs, or widely known best practices.
Append at the end of your normal response. Never interrupt workflow.
Template:
💡 TIL: [concise title of the insight]
Tags: [tag1, tag2] · Capture? (yes/no)
Example (at the end of a debugging response):
...so the fix is to close the channel before the goroutine exits.
💡 TIL: Unclosed Go channels in goroutines cause silent memory leaks
Tags: go, concurrency · Capture? (yes/no)
Auto-detected TILs bypass the extract flow. The suggestion itself is the candidate.
yes / y / ok / sure → agent generates full entry (title, body, tags, lang) from the suggested insight → follows Execution Flow (POST or save locally)no / ignores / continues other topic → move on, do not ask againNon-affirmative responses (continuing the conversation about something else) are treated as implicit decline.
Detailed trigger examples, state machine, and anti-patterns: see references/auto-detection.md
Management subcommands require a token. There is no local fallback -- management operations need the API.
/til list [drafts|published|all]List entries. Default filter: drafts.
GET /entries?status=<filter>&per_page=10...)/til publish [<id> | last]Publish a draft entry.
last resolves to the most recently created entry in this session (tracked via last_created_entry_id set on every successful POST)/til unpublish <id>Revert a published entry to draft.
/til edit <id> [instructions]AI-assisted editing of an existing entry.
GET /entries/:idPATCH /entries/:id with only the changed fields/til search <keyword>Search entries by title.
GET /entries?q=<keyword>&per_page=10list/til delete <id>Permanently delete an entry.
DELETE /entries/:id/til statusShow site status and connection info. Works without a token (degraded display).
GET /site -> show username, entry breakdown (total/published/drafts), token status, local draft count, dashboard link/til syncExplicitly sync local drafts from ~/.til/drafts/ to OpenTIL. Requires token.
/til tagsList site tags sorted by usage count (top 20). Requires token.
GET /tags?sort=popular&per_page=20&with_entries=true/til categoriesList site categories. Requires token.
GET /categories/til batch <topics>Batch-capture multiple TIL entries in one invocation. Requires explicit topic list.
- / 1.)/til sync)... + last 8 charactersTrack the following session state (not persisted across sessions):
last_created_entry_id -- set on every successful POST /entries (201). Used by /til publish last.active_profile -- the profile name resolved at first token access. Reflects the active field from ~/.til/credentials (or $OPENTIL_TOKEN override). Used for identity display and draft attribution.Detailed subcommand flows, display formats, and error handling: see references/management.md
Three layers of attribution signal distinguish human-initiated from agent-initiated TILs.
Include these headers on every API call:
X-OpenTIL-Source: human | agent
X-OpenTIL-Agent: <your agent display name>
X-OpenTIL-Model: <human-readable model name>
/til <content> and /til -> human; Auto-detected -> agentClaude Code, Cursor, GitHub Copilot). Do not use a slug.Claude Opus 4.6, GPT-4o, Gemini 2.5 Pro). Do not use a model ID.agent-assisted to the tag list/til <content> and /til: do not add the tag (unless the Agent substantially rewrote the content)Agent-initiated TILs are visually marked on OpenTIL automatically based on the
source field. No content modification needed -- the backend renders attribution
in the display layer.
✨ via {agent_name}, or ✨ AI when agent_name is absent{agent_name} · {model} when both are presentDo NOT append any footer or attribution text to the content body.
| Dimension | /til <content> | /til | Auto-detected |
|---|---|---|---|
| Trigger | User explicit | User command | Agent proactive |
| Confirmations | 0 (direct publish) | 1 (review before publish) | 1 (suggest → capture) |
| Source header | human | human | agent |
| Agent header | Yes | Yes | Yes |
| Model header | Yes | Yes | Yes |
agent-assisted tag | No | No | Yes |
| Attribution | Automatic (backend) | Automatic (backend) | Automatic (backend) |
Every TIL entry must follow these rules:
$inline$ / $$display$$) for formulas with fractions/subscripts/superscripts/greek letters, Mermaid diagrams (```mermaid) for flows/states/sequences that text cannot clearly express. Simple expressions like O(n) stay as inline code; use math only when notation complexity warrants it. Only use prose when explaining causation or context. Never pad content; if one sentence suffices, don't write a paragraph.go, rails, postgresql, css, linux). No generic tags like programming or til.zh-CN, Traditional Chinese -> zh-TW, English -> en, Japanese -> ja, Korean -> ko.category_name -- only include it if the user explicitly specifies a category/topic.Published to OpenTIL
Title: Go interfaces are satisfied implicitly
Tags: go, interfaces
URL: https://opentil.ai/@username/go-interfaces-are-satisfied-implicitly
When ≥2 profiles are configured, add an Account line:
Published to OpenTIL
Account: @hong (personal)
Title: Go interfaces are satisfied implicitly
Tags: go, interfaces
URL: https://opentil.ai/@hong/go-interfaces-are-satisfied-implicitly
Single-profile users see no Account line — keep the output clean.
Extract the url field from the API response for the URL.
After the first successful API call, check ~/.til/drafts/ for pending files. If any exist, offer to sync:
Draft saved to OpenTIL
Title: Go interfaces are satisfied implicitly
Tags: go, interfaces
Review: https://opentil.ai/@username/go-interfaces-are-satisfied-implicitly
Found 3 local drafts from before. Sync them to OpenTIL?
On confirmation, POST each draft to the API. Delete the local file after each successful sync. Keep files that fail. Show summary:
Synced 3 local drafts to OpenTIL
+ Go defer runs in LIFO order
+ PostgreSQL JSONB indexes support GIN operators
+ CSS :has() selector enables parent selection
If the user declines, keep the local files and do not ask again in this session.
Save the draft locally, then proactively offer to connect. This is NOT an error -- the user successfully captured a TIL.
TIL captured
Title: Go interfaces are satisfied implicitly
Tags: go, interfaces
File: ~/.til/drafts/20260210-143022-go-interfaces.md
Connect to OpenTIL to publish entries online.
Connect now? (y/n)
y → run inline device flow (same as /til auth) → on success, sync the just-saved draft + any other pending drafts in ~/.til/drafts/n → show manual setup instructions (see Manual Setup Instructions below)Only show the connect prompt on the first local save in this session. On subsequent saves, use the short form (no prompt):
TIL captured
Title: Go interfaces are satisfied implicitly
Tags: go, interfaces
File: ~/.til/drafts/20260210-143022-go-interfaces.md
On ANY API failure, always save the draft locally first. Never let user content be lost.
422 -- Validation error: Analyze the error response, fix the issue (e.g. truncate title to 200 chars, correct lang code), and retry. Only save locally if the retry also fails.
401 -- Token invalid or expired (token from ~/.til/credentials active profile):
TIL captured (saved locally)
File: ~/.til/drafts/20260210-143022-go-interfaces.md
Token expired for @hong (personal). Reconnect now? (y/n)
y → run inline device flow (same as /til auth) → on success, update the active profile's token in ~/.til/credentials and auto-retry the original POST (publish the just-saved draft, then delete the local file)n → show manual setup instructions (see Manual Setup Instructions below)When only one profile exists, omit the @nickname (profile) from the message.
401 -- Token invalid or expired (token from $OPENTIL_TOKEN env var):
The env var takes priority over ~/.til/credentials, so saving a new token via device flow would not help — the env var would still be used. Guide the user instead:
TIL captured (saved locally)
File: ~/.til/drafts/20260210-143022-go-interfaces.md
Your $OPENTIL_TOKEN is expired or invalid. To fix:
• Update the variable with a new token, or
• unset OPENTIL_TOKEN, then run /til auth
Create a new token: https://opentil.ai/dashboard/settings/tokens
Network failure or 5xx:
TIL captured (saved locally -- API unavailable)
File: ~/.til/drafts/20260210-143022-go-interfaces.md
Full error codes, 422 auto-fix logic, and rate limit details: see references/api.md
| Rule | Behavior |
|---|---|
| No retry loops | If re-auth succeeds but the retry still returns 401 → stop and show the error. Do not re-authenticate again. |
| Batch-aware | During batch/sync operations, re-authenticate at most once. On success, continue processing remaining items with the new token. |
| Respect refusal | If the user declines re-authentication (n), do not prompt again for the rest of this session. Use the short local-save format silently. |
| Env var awareness | When the active token comes from $OPENTIL_TOKEN, never attempt device flow — it cannot override the env var. Always show the env var guidance instead. |
| Profile-aware re-auth | On successful re-authentication, update the corresponding profile's token in ~/.til/credentials. Do not create a new profile. |
When the user declines inline authentication (answers n), show:
Or set up manually:
1. Visit https://opentil.ai/dashboard/settings/tokens
2. Create a token (select read + write + delete scopes)
3. Add to shell profile:
export OPENTIL_TOKEN="til_..."
When the API is unavailable or no token is configured, drafts are saved locally to ~/.til/drafts/.
File format: YYYYMMDD-HHMMSS-<slug>.md
---
title: "Go interfaces are satisfied implicitly"
tags: [go, interfaces]
lang: en
summary: "Go types implement interfaces implicitly by implementing their methods, with no explicit declaration needed."
profile: personal
---
In Go, a type implements an interface...
The profile field records the active profile name at save time, ensuring sync uses the correct account's token. Omitted when no profiles are configured (backward-compatible).
Full directory structure, metadata fields, and sync protocol: see references/local-drafts.md
lang field) is independent -- it is always detected from the content itself.published: true) -- use /til unpublish <id> to revert to draftlist, publish, edit, search, delete, tags, categories, sync, batch) require a token -- no local fallback. Exception: status and auth (including auth switch, auth list, auth remove, auth rename) work without a token.list/search/tags/categories need read:entries, publish/unpublish/edit/sync/batch need write:entries, delete needs delete:entries. status uses read:entries when available but works without a token.