๐ CellMage Magic Command Cheatsheetยถ
This cheatsheet provides a comprehensive reference for all CellMage magic commands and their arguments.
Core Magic Commandsยถ
1. %llm_config - Configuration Magicยถ
%llm_config [options]
Argument |
Description |
|---|---|
|
Select and activate a persona by name |
|
Show the currently active persona details |
|
List available persona names |
|
List current model name mappings |
|
Add a model name mapping (e.g., |
|
Remove a model name mapping |
|
Set a temporary LLM param override (e.g., |
|
Remove a specific override key |
|
Clear all temporary LLM param overrides |
|
Show the currently active overrides |
|
Clear the current chat history (keeps system prompt) |
|
Display the current message history |
|
Save session. If no name, uses current session ID. โ.mdโ added automatically |
|
Load session from specified identifier (filename without .md) |
|
List saved session identifiers |
|
Enable automatic saving of conversations to the conversations directory |
|
Disable automatic saving of conversations |
|
List available snippet names |
|
Add user snippet content before sending prompt (can be used multiple times) |
|
Add system snippet content before sending prompt (can be used multiple times) |
|
Show current status (persona, overrides, history length) |
|
Set the default model for the LLM client |
|
Switch to a different LLM adapter implementation |
2. %%llm - LLM Cell Magicยถ
%%llm [options]
Your prompt to the LLM goes here...
Argument |
Description |
|---|---|
|
Use specific persona for THIS call only |
|
Use specific model for THIS call only |
|
Set temperature for THIS call |
|
Set max_tokens for THIS call |
|
Do not add this exchange to history |
|
Do not stream output (wait for full response) |
|
Disable auto-rollback check for this cell run |
|
Set any other LLM param ad-hoc (e.g., |
|
List available snippet names |
|
Add user snippet content before sending prompt (can be used multiple times) |
|
Add system snippet content before sending prompt (can be used multiple times) |
3. %llm_config_persistent - Ambient Mode Magicยถ
%llm_config_persistent [options]
Accepts the same arguments as %llm_config but also enables ambient mode (all regular cells are processed as LLM prompts).
4. %disable_llm_config_persistent - Disable Ambient Modeยถ
%disable_llm_config_persistent
Disables ambient mode, returning the notebook to normal operation.
5. %%py - Execute Python in Ambient Modeยถ
%%py
# Python code to run
print("Hello World")
When ambient mode is active, this magic command lets you execute a specific cell as Python code.
Integration Magic Commandsยถ
1. %confluence - Confluence Wiki Integrationยถ
%confluence [identifier] [options]
Argument |
Description |
|---|---|
|
Page identifier (SPACE:Title format or page ID) |
|
Confluence Query Language (CQL) search query |
|
Maximum number of results for CQL queries (default: 5) |
|
Add content as a system message (rather than user) |
|
Display the content without adding to history |
|
Use plain text format instead of Markdown (Markdown is default) |
|
For CQL search, return only metadata without page content |
|
For CQL search, fetch full content of each page (makes additional API calls) |
2. %jira - Jira Integrationยถ
%jira [issue_key] [options]
Argument |
Description |
|---|---|
|
Jira issue key (e.g., PROJECT-123) |
|
JQL search query instead of a specific issue |
|
Maximum number of results for JQL search (default: 5) |
|
Comma-separated list of fields to include |
|
Include issue comments |
|
Add as system message instead of user message |
|
Display content without adding to history |
|
Use plain text instead of Markdown format |
3. %github - GitHub Integrationยถ
%github [repo/path] [options]
Argument |
Description |
|---|---|
|
Repository owner/name or file path within a repository |
|
Fetch a specific issue by number |
|
Fetch a specific pull request by number |
|
Search for issues with the given query |
|
Maximum number of search results (default: 5) |
|
Include comments on issues/PRs |
|
Add as system message instead of user message |
|
Display content without adding to history |
|
Branch to use when fetching files (default: main/master) |
4. %gitlab - GitLab Integrationยถ
%gitlab [repo/path] [options]
Argument |
Description |
|---|---|
|
Project path or file path within a project |
|
Fetch a specific issue by number |
|
Fetch a specific merge request by number |
|
Search for issues with the given query |
|
Maximum number of search results (default: 5) |
|
Include comments on issues/MRs |
|
Add as system message instead of user message |
|
Display content without adding to history |
|
Branch to use when fetching files (default: main/master) |
5. %webcontent - Web Content Integrationยถ
%webcontent [url] [options]
Argument |
Description |
|---|---|
|
URL of the webpage to fetch |
|
Clean and extract main content (default behavior) |
|
Get raw HTML content without cleaning |
|
Content extraction method: trafilatura (default), bs4, or simple |
|
Add as system message instead of user message |
|
Display content without adding to history |
|
Include image references in the output |
|
Remove hyperlinks from the output |
|
Request timeout in seconds (default: 30) |
6. %gdocs - Google Docs Integrationยถ
%gdocs [document_id] [options]
Argument |
Description |
|---|---|
|
Google Document ID |
|
Add as system message instead of user message |
|
Display content without adding to history |
|
Search for Google Docs files containing the specified term |
|
Retrieve and display content for search results |
|
Maximum number of search results to return (default: 10) |
|
Maximum number of documents to retrieve content for (default: 3) |
|
Request timeout in seconds (default: 300) |
|
Filter documents by author/owner email (comma-separated for multiple) |
|
Filter by modification date (YYYY-MM-DD or natural language) |
|
How to order search results (relevance, modifiedTime, createdTime, name) |
|
Authentication type to use (oauth or service_account) |
7. %sqlite - SQLite Storage Managementยถ
%sqlite [options]
Argument |
Description |
|---|---|
|
Show the current state of the SQLite storage |
|
Display statistics about stored conversations |
|
List all stored conversations |
|
Start a new conversation |
|
Load a specific conversation by ID |
|
Delete a conversation by ID |
|
Add a tag to a conversation |
|
Search for conversations with content matching the query |
|
Export a conversation to markdown file |
|
Import a conversation from markdown file |
8. %img - Image Processing and Integrationยถ
%img image_path [options]
Argument |
Description |
|---|---|
|
Path to the image file to process |
|
Width to resize the image to (maintains aspect ratio) |
|
Quality for lossy image formats (0.0-1.0) |
|
Display the image inline after processing |
|
Display information about the image |
|
Add the image to the chat session (default: always added) |
|
Force conversion to a compatible format |
|
Format to convert the image to (e.g., โjpgโ, โpngโ, โwebpโ) |
Example Usageยถ
Core Commandsยถ
# Load the extension
%load_ext cellmage
# Set the default model and persona
%llm_config --model gpt-4o --persona python_expert
# Ask a question with a specific model for this call only
%%llm -m gpt-4o
Explain the visitor pattern in software design
# Enable ambient mode with specific settings
%llm_config_persistent --model gpt-4o-mini --temperature 0.7
# Execute Python code in ambient mode
%%py
import pandas as pd
print(pd.__version__)
# Disable ambient mode
%disable_llm_config_persistent
Integration Commandsยถ
# Load Confluence extension
%load_ext cellmage
# Fetch a Confluence page
%confluence TEAM:Project Overview
# Search Confluence
%confluence --cql "space = DEV AND title ~ 'Architecture'"
# Load GitHub extension
%load_ext cellmage
# Get a specific GitHub issue
%github myorg/myrepo --issue 42
# Get web content
%load_ext cellmage
%webcontent https://example.com/article
# Process and display an image
%load_ext cellmage
%img path/to/image.jpg --resize 1024 --show --info