Skip to main content

nut knowledge

Manage knowledge base documents in your Coconut instance.
nut knowledge [command]

Overview

The knowledge base stores important information, documentation, and reference materials that AI skills can access when working on tasks. Unlike context documents which provide project-wide information, knowledge documents can cover specific topics, APIs, patterns, or any other reference material.

nut knowledge list

List all knowledge documents.
nut knowledge list [options]
Options:
  • --search <query> - Search documents by title or content
  • --json - Output as JSON
Examples:
# List all knowledge documents
nut knowledge list

# Search for specific topics
nut knowledge list --search "authentication"
nut knowledge list --search "API"

# Output as JSON
nut knowledge list --json

nut knowledge get

Get a specific knowledge document by filename.
nut knowledge get <filename> [options]
Arguments:
  • filename - The document filename (e.g., api-design.md)
Options:
  • --json - Output as JSON
Examples:
# Read a document
nut knowledge get api-design.md

# Get as JSON
nut knowledge get api-design.md --json

# Read coding standards
nut knowledge get coding-standards.md

nut knowledge create

Create a new knowledge document.
nut knowledge create <title> [options]
Arguments:
  • title - Document title
Options:
  • --file <path> - Path to file containing document content
  • --content <text> - Direct content for the document
Examples:
# Create from file
nut knowledge create "API Design Guidelines" --file ./content.md

# Create with inline content
nut knowledge create "Quick Note" --content "# Quick Note\n\nSome important information here"

# Create coding standards doc
nut knowledge create "TypeScript Best Practices" --file ./docs/typescript.md
Use descriptive titles that make it easy to find documents later. Filenames are automatically generated from titles.

nut knowledge update

Update an existing knowledge document.
nut knowledge update <filename> [options]
Arguments:
  • filename - The document filename to update
Options:
  • --file <path> - Path to file with new content
  • --title <title> - Update the document title
  • --content <text> - Direct content update
Examples:
# Update from file
nut knowledge update api-design.md --file ./updated.md

# Update title
nut knowledge update api-design.md --title "API Design Guidelines v2"

# Update content directly
nut knowledge update api-design.md --content "# Updated Content\n\n..."

# Update both title and content
nut knowledge update api-design.md --title "New Title" --file ./new-content.md

nut knowledge delete

Delete a knowledge document.
nut knowledge delete <filename>
Arguments:
  • filename - The document filename to delete
Examples:
nut knowledge delete api-design.md
nut knowledge delete old-notes.md
Deleting a knowledge document is permanent. Make sure you no longer need the information before confirming.

Knowledge Base Use Cases

API Documentation

# Create API reference
nut knowledge create "REST API Reference" --file ./docs/api-reference.md

# Document authentication
nut knowledge create "Authentication Guide" --content "# Authentication\n\nOur API uses JWT tokens..."

Coding Standards

# Add style guide
nut knowledge create "JavaScript Style Guide" --file ./docs/js-style.md

# Document patterns
nut knowledge create "Design Patterns" --content "# Common Design Patterns\n\n## Factory Pattern..."

Third-Party Integration

# Document external services
nut knowledge create "Stripe Integration" --file ./docs/stripe.md
nut knowledge create "AWS S3 Usage" --file ./docs/s3-guide.md

Project History & Decisions

# Architecture decisions
nut knowledge create "Why We Chose PostgreSQL" --file ./docs/decisions/postgres.md

# Migration guides
nut knowledge create "v1 to v2 Migration Guide" --file ./docs/migration.md

Best Practices

Create separate documents for different topics rather than one large document. This makes it easier for AI skills to find relevant information.
Regularly review and update knowledge documents as your project evolves. Outdated information can lead to incorrect implementations.
Structure documents with headings, bullet points, and code examples. Well-formatted documents are easier for both humans and AI to parse.
Whenever possible, include code examples and real-world use cases. Examples help AI skills understand how to apply the information.

Knowledge Base Workflow

1

Create foundational docs

nut knowledge create "API Guidelines" --file ./docs/api.md
nut knowledge create "Database Schema" --file ./docs/schema.md
nut knowledge create "Deployment Process" --file ./docs/deploy.md
2

Add as you learn

When you encounter something worth documenting:
nut knowledge create "Redis Caching Strategy" --content "# Redis Usage\n\n..."
3

Update regularly

nut knowledge update api-guidelines.md --file ./docs/api-v2.md
4

Search when needed

nut knowledge list --search "caching"
nut knowledge get redis-caching-strategy.md
5

Clean up outdated docs

nut knowledge delete old-api-docs.md

Knowledge vs Context

Context Documents provide high-level, project-wide information:
  • Project goals and requirements
  • Overall architecture
  • Team roles and expectations
Knowledge Base contains specific, topic-focused information:
  • API documentation
  • Specific patterns and practices
  • Integration guides
  • Technical specifications
Both work together to give AI skills a complete understanding of your project.