### Install OpenKnowledge CLI and Initialize Project
Source: https://openknowledge.ai/docs/get-started/quickstart.mdx
Install the OpenKnowledge CLI globally using npm. Then, create a new project directory, navigate into it, and initialize a new knowledge base. This command scaffolds the necessary configuration files and sets up integrations with AI agents.
```bash
# Install the CLI (puts `ok` on your PATH)
npm install -g @inkeep/open-knowledge
# Create (or enter) a project folder, then initialize a knowledge base.
# `ok init` scaffolds .ok/ and wires up Claude Code, Cursor, Codex, and OpenCode.
mkdir my-knowledge-base && cd my-knowledge-base
ok init
```
--------------------------------
### Install OpenKnowledge CLI
Source: https://openknowledge.ai/docs/reference/cli
Install the OpenKnowledge CLI globally using npm. This makes the `ok` command available on your system's PATH.
```bash
npm install -g @inkeep/open-knowledge
```
--------------------------------
### Start OpenKnowledge App
Source: https://openknowledge.ai/docs/reference/cli
Launch the OpenKnowledge web application in your browser after initializing a project. The `--open` flag automatically opens the app.
```bash
ok start --open
```
--------------------------------
### Install MCP for Codex
Source: https://openknowledge.ai/docs/integrations/codex.mdx
Use this command to install the MCP integration for Codex. Ensure you have the necessary editor and tool configurations.
```bash
```
--------------------------------
### Standup Template Example
Source: https://openknowledge.ai/docs/advanced/folders-and-templates
This markdown file defines a daily standup template. It includes template metadata and uses placeholders for the date and user.
```markdown
---
template:
title: Daily standup
description: Standup notes scaffold
---
# Standup — {{date}}
Recorded by {{user}}
## Yesterday
## Today
## Blockers
```
--------------------------------
### Basic .okignore Patterns
Source: https://openknowledge.ai/docs/features/ignore-patterns
This example demonstrates common ignore patterns using gitignore syntax. It shows how to exclude directories, files matching a pattern, and re-include previously excluded files.
```text
# Exclude a directory
drafts/
# Exclude any file matching a pattern
*.draft.md
# Re-include a file .gitignore excluded
!keep.md
```
--------------------------------
### Person Dossier Example
Source: https://openknowledge.ai/docs/workflows/entity-vault.mdx
A GBrain-compatible Markdown document representing a person, including frontmatter and compiled truth.
```markdown
---
type: person
title: Jane Founder
created: 2026-05-12
author: mike
tags: [person, founder]
---
## Compiled truth
Co-founder and CEO of [[companies/jane-co|Jane Co]]. Met through
[[people/alex-seed-investor|Alex Seed Investor]]. Strong on cost-per-token
economics; go-to-market is still developing.
---
timeline ---
## Timeline
- **2026-05-12** | [[meetings/2026-05-12-jane-founder-coffee|coffee meeting]] | @mike — Jane described Jane Co's agent-runtime observability wedge. Confidence: direct note.
- **2026-05-13** | agent enrichment | @agent — Public GitHub profile confirms prior OSS profiler work. Confidence: external profile.
```
--------------------------------
### Meeting Notes Example
Source: https://openknowledge.ai/docs/workflows/entity-vault.mdx
Markdown document for a meeting, capturing attendees, context, and key quotes, intended for agent processing.
```markdown
---
type: meeting
title: Jane Founder coffee
date: 2026-05-12
attendees: [Jane Founder]
tags: [meeting, ai-infra]
---
## Notes
Jane runs [[companies/jane-co|Jane Co]], a stealth AI infra company focused on
[[concepts/agent-runtime-observability|agent-runtime observability]].
Introduced by [[people/alex-seed-investor|Alex Seed Investor]].
Quote: "the agent runtime is the new kernel."
```
--------------------------------
### Get Preview URL for Touched Document
Source: https://openknowledge.ai/docs/reference/mcp.mdx
Mutating tools return a `previewUrl` which is route-only. Use `preview_url` to resolve the full, openable URL for the document.
```javascript
preview_url()
```
--------------------------------
### Get Document Lifecycle Status
Source: https://openknowledge.ai/docs/reference/mcp.mdx
Use `exec("cat …")` to retrieve the lifecycle status and reason for any document, including conflicted ones.
```javascript
exec("cat …")
```
--------------------------------
### Re-include a file excluded by .gitignore
Source: https://openknowledge.ai/docs/features/ignore-patterns
To make a file visible in OpenKnowledge that is excluded by your project's .gitignore file, add a negation pattern starting with '!' to your .okignore file.
```text
!secret.md
```
--------------------------------
### Initialize OpenKnowledge Project
Source: https://openknowledge.ai/docs/reference/cli
Run `ok init` in your project's root directory to scaffold the necessary `.ok/` directory and register the OpenKnowledge MCP server with detected AI editors. This command is safe for existing configurations.
```bash
cd my-project
ok init
```
--------------------------------
### Initialize Knowledge Base with Prompt
Source: https://openknowledge.ai/docs/get-started/quickstart.mdx
Use this prompt to create a knowledge base about Large Language Models, including an overview and specific concept pages. Ensure your agent is set to auto-mode for uninterrupted tool calls.
```text
Create a knowledge base about Large Language Models. Include an overview page and separate pages for three key concepts.
```
--------------------------------
### Initialize OpenKnowledge Project
Source: https://openknowledge.ai/docs/get-started/quickstart.mdx
Initialize your project to register OpenKnowledge with AI editors, enabling them to use OpenKnowledge tools.
```bash
ok init
```
--------------------------------
### List All Running Servers
Source: https://openknowledge.ai/docs/reference/cli
List all active OpenKnowledge servers running on your machine, regardless of the current directory.
```bash
ok ps
```
--------------------------------
### List All Conflicted Documents
Source: https://openknowledge.ai/docs/reference/mcp.mdx
Call `conflicts` with `kind: "list"` to get a list of all documents currently in a conflicted state, including their status and reason.
```javascript
conflicts({ kind: "list" })
```
--------------------------------
### Open a Single File with OpenKnowledge CLI
Source: https://openknowledge.ai/docs/features/editor
Use the `ok` command to open a single markdown file in the editor. If the file is within an existing OpenKnowledge project, the project will open focused on that document. Otherwise, it launches an ephemeral single-file session.
```bash
ok notes.md # open a single file in the editor
ok ./specs/foo/SPEC.md # a file inside a project opens that project, focused on the doc
```
--------------------------------
### Import and Sync Markdown Vault with GBrain
Source: https://openknowledge.ai/docs/workflows/entity-vault.mdx
Commands to import, embed, and sync your Markdown vault with gbrain. Use `--no-embed` for initial bulk loads to avoid embedding during the scan. Run `gbrain embed --stale` after import or no-embed syncs. Commit OK changes, then run `gbrain sync --repo` for incremental refresh.
```bash
gbrain import ~/your-ok-vault --no-embed
gbrain embed --stale
gbrain sync --repo ~/your-ok-vault
```
--------------------------------
### Clone GitHub Repository
Source: https://openknowledge.ai/docs/reference/cli
Clone a repository from GitHub and open it with OpenKnowledge. Supports both `owner/repo` shorthand and full URLs. Initializes OpenKnowledge if the repository is not already set up.
```bash
ok clone
```
--------------------------------
### Seed Entity Vault Pack
Source: https://openknowledge.ai/docs/workflows/entity-vault.mdx
Run this command to create a new entity vault structure.
```bash
ok seed --pack entity-vault
```
--------------------------------
### Authenticate for Private Repositories
Source: https://openknowledge.ai/docs/reference/cli
Log in to authenticate with GitHub to clone private repositories. If you are already logged in with the `gh` CLI, this step can be skipped.
```bash
ok auth login
```
--------------------------------
### Configure OpenCode with Local Model and OpenKnowledge
Source: https://openknowledge.ai/docs/integrations/opencode.mdx
This JSON configuration sets up OpenCode to connect to your OpenKnowledge MCP server and a local OpenAI-compatible model, such as Ollama. Ensure your model supports tool/function calling.
```json
{
"$schema": "https://opencode.ai/config.json",
// Added by `ok init` — connects OpenCode to your knowledge base.
"mcp": {
"open-knowledge": { "type": "local", "enabled": true, "command": ["..."] }
},
// Your local model, via any OpenAI-compatible endpoint (Ollama shown).
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"options": { "baseURL": "http://localhost:11434/v1" },
"models": { "qwen3-coder:30b": {} }
}
}
}
```
--------------------------------
### Verify Codex Integration
Source: https://openknowledge.ai/docs/integrations/codex.mdx
Run this command within Codex to verify that OpenKnowledge is correctly integrated and accessible. If the tool is not found, restart Codex. If issues persist, check your ~/.codex/config.toml file.
```bash
```
--------------------------------
### Check Server Status
Source: https://openknowledge.ai/docs/reference/cli
Display whether the OpenKnowledge server and UI are currently running for the active project.
```bash
ok status
```
--------------------------------
### Open Single File
Source: https://openknowledge.ai/docs/reference/cli
Open a specific file directly in the OpenKnowledge editor without initializing a full project. This is useful for quick edits or reviewing individual files.
```bash
ok open
```
--------------------------------
### Import Timeline and Restore Icons
Source: https://openknowledge.ai/docs/features/timeline-and-recovery
Imports necessary icons for timeline and restore functionality from the 'lucide-react' library.
```javascript
import { Clock, Undo2 } from 'lucide-react';
```
--------------------------------
### Agent Creates Document from Template
Source: https://openknowledge.ai/docs/advanced/folders-and-templates
This command is used by AI agents via MCP to create a new document from a specified template. The template is selected based on its applicability to the document's path.
```text
write({ document: { path: "posts/launch", template: "blog-post" } })
```
--------------------------------
### Enable Semantic Search Configuration
Source: https://openknowledge.ai/docs/reference/configuration.mdx
To enable semantic search, set 'search.semantic.enabled' to true in your project's local configuration file. You can also optionally configure a non-OpenAI provider by specifying 'search.semantic.baseUrl', 'model', and 'dimensions'.
```yaml
search.semantic.enabled: true
# Optional: Configure a non-OpenAI provider
# search.semantic.baseUrl: "http://localhost:11434/v1"
# search.semantic.model: "nomic-embed-text"
# search.semantic.dimensions: 768
```
--------------------------------
### Daily Entry Template with Properties
Source: https://openknowledge.ai/docs/advanced/folders-and-templates
This template defines a daily journal entry, including default properties like type, description, title, status, and tags. These properties are automatically applied to new documents.
```markdown
---
template:
title: Daily entry
description: Daily journal entry.
type: daily-note
description: Daily journal entry capturing intentions, notes, and reflections.
title: {{date}}
status: draft
tags: [daily]
---
## Morning intentions
(...)
```
--------------------------------
### Entity Vault Directory Structure
Source: https://openknowledge.ai/docs/workflows/entity-vault.mdx
The default directory structure created by the entity-vault seed.
```txt
your-project/
└── vault/
├── USER.md
├── SOUL.md
├── ACCESS_POLICY.md
├── HEARTBEAT.md
├── log.md
├── people/
├── companies/
├── meetings/
├── concepts/
├── originals/
└── media/
```
--------------------------------
### Stop OpenKnowledge Server
Source: https://openknowledge.ai/docs/reference/cli
Stop the OpenKnowledge server for the current directory. You can also specify a port, path, PID, or 'all' to stop multiple servers.
```bash
ok stop
```
--------------------------------
### Inspect and Resolve GitHub Conflicts
Source: https://openknowledge.ai/docs/reference/mcp.mdx
Use `conflicts` to inspect merge stages and `resolve_conflict` to choose a resolution strategy ('mine', 'theirs', 'content', or 'delete').
```javascript
conflicts({ kind: "content", file })
resolve_conflict({
kind: "mine" | "theirs" | "content" | "delete",
file
})
```
--------------------------------
### Wiki-embed Reference
Source: https://openknowledge.ai/docs/features/assets-and-embeds
Wiki-embeds are displayed as a styled code block when shared cross-app if the destination app does not have access to the filesystem.
```markdown
![[diagram.png]]
```
--------------------------------
### Public IP Literal URL Reference
Source: https://openknowledge.ai/docs/features/assets-and-embeds
Image references using public IP literals are passed through unchanged when shared cross-app.
```markdown
https://1.2.3.4/img.png
```
--------------------------------
### Public IPv6 Literal URL Reference
Source: https://openknowledge.ai/docs/features/assets-and-embeds
Image references using public IPv6 literals are passed through unchanged when shared cross-app.
```markdown
https://[2001:4860:4860::8888]/img.png
```
--------------------------------
### Agent Prompt for Dossier Update
Source: https://openknowledge.ai/docs/workflows/entity-vault.mdx
A text prompt instructing an MCP-capable agent to create or update entity dossiers and append timeline entries based on a meeting note.
```txt
From meetings/2026-05-12-jane-founder-coffee.md, create or update the
referenced person, company, and concept dossiers using the Entity vault (GBrain-compatible Markdown) templates. Append dated timeline bullets. Do not rewrite existing timeline entries.
```
--------------------------------
### Wiki-link Reference
Source: https://openknowledge.ai/docs/features/assets-and-embeds
Wiki-links are converted to anchor links when shared cross-app, signaling a reference even if the fragment href does not resolve.
```markdown
[[OtherDoc]]
```