Documentation

Command Reference

This reference documents all available commands and options for ThinkCode's command-line interface (CLI) and internal Command Palette commands. These tools allow you to control and customize ThinkCode through text-based commands, providing efficient alternatives to using the graphical interface.

Command-Line Interface (CLI)

ThinkCode offers a powerful command-line interface that enables launching the application with specific options, opening files or projects, and performing various operations.

Basic Usage

The basic syntax for the ThinkCode CLI is:

thinkcode [options] [path]

Where:

  • [options] are command-line flags that modify behavior
  • [path] is a file, folder, or workspace to open

Global Options

OptionDescription
--help, -hDisplay help information about available commands and options
--version, -vDisplay ThinkCode version information
--statusPrint process usage and diagnostics information
--disable-extensionsDisable all installed extensions
--disable-gpuDisable GPU hardware acceleration
--verbosePrint verbose output (implies --wait)
--log <level>Set log level (critical, error, warn, info, debug, trace)

Window Management

OptionDescription
--new-window, -nOpen a new window
--reuse-window, -rForce opening a file or folder in an already opened window
--wait, -wWait for the file to be closed before returning
--diff <file1> <file2>Compare two files in a diff editor
--add <folder>Add a folder to the current workspace

File/Project Options

OptionDescription
--goto <file:line[:character]>Open a file at a specific line and optional character position
--folder-uri <uri>Open a folder from a URI
--file-uri <uri>Open a file from a URI
--workspace <workspacePath>Open a specific workspace file

Development Options

OptionDescription
--extensions-dir <dir>Set the root path for extensions
--user-data-dir <dir>Specify the directory where user data is stored
--disable-crash-reporterDisable crash reporting
--disable-telemetryDisable telemetry reporting
--disable-updatesDisable updates
--inspect-extensionsEnable debugging of extensions
--inspect-brk-extensionsEnable debugging of extensions with the extension host being paused after startup

Extension Management

OptionDescription
--install-extension <extension-id>[@<version>]Install or update an extension
--uninstall-extension <extension-id>Uninstall an extension
--list-extensionsList the installed extensions
--show-versionsShow versions of installed extensions when using --list-extensions
--enable-proposed-api <extension-id>Enable proposed API features for specific extensions

Advanced Options

OptionDescription
--profileRun with performance profile enabled
--prof-startupRun with startup performance profile enabled
--disable-workspace-trustDisable workspace trust prompt
--max-memory <memory>Max memory size for ThinkCode in MB
--sync <on/off>Turn on/off settings sync
--locate-shell <shell-name>Locate the specified shell

Examples

# Open ThinkCode
thinkcode
 
# Open a file
thinkcode path/to/file.js
 
# Open a folder
thinkcode path/to/project/
 
# Open multiple files
thinkcode file1.js file2.js
 
# Open a file at a specific line and column
thinkcode --goto path/to/file.js:10:5
 
# Compare two files
thinkcode --diff file1.js file2.js
 
# Install an extension
thinkcode --install-extension publisher.extension-name
 
# List installed extensions
thinkcode --list-extensions
 
# Open a new window with extensions disabled
thinkcode --new-window --disable-extensions

Command Palette

The Command Palette provides access to nearly all ThinkCode functionality through commands. Access it with Ctrl+Shift+P (Windows/Linux) or ⌘+Shift+P (macOS).

File Commands

CommandDescription
File: New FileCreate a new file
File: New FolderCreate a new folder
File: Open...Open a file
File: Open Folder...Open a folder
File: Open RecentShow recently opened files or folders
File: SaveSave the current file
File: Save As...Save the current file with a different name
File: Save AllSave all open files
File: CloseClose the current editor
File: Close AllClose all open editors
File: Close FolderClose the currently opened folder
File: Revert FileRevert the current file to the saved version
File: Auto SaveToggle auto-save feature

Edit Commands

CommandDescription
Edit: UndoUndo the last edit action
Edit: RedoRedo the previously undone action
Edit: CutCut the selected text
Edit: CopyCopy the selected text
Edit: PastePaste from clipboard
Edit: FindSearch in the current file
Edit: ReplaceSearch and replace in the current file
Edit: Find in FilesSearch across all files
Edit: Replace in FilesSearch and replace across all files
Edit: Toggle Line CommentComment/uncomment the current line
Edit: Toggle Block CommentComment/uncomment the selected block
Edit: Format DocumentFormat the entire document
Edit: Format SelectionFormat the selected text

View Commands

CommandDescription
View: Toggle Side Bar VisibilityShow or hide the side bar
View: Toggle Status Bar VisibilityShow or hide the status bar
View: Toggle Activity Bar VisibilityShow or hide the activity bar
View: Toggle PanelShow or hide the panel
View: Zoom InIncrease the editor font size
View: Zoom OutDecrease the editor font size
View: Reset ZoomReset the editor font size to default
View: Toggle Full ScreenEnter or exit full screen mode
View: Toggle Zen ModeEnter or exit zen mode
View: Toggle Word WrapEnable or disable word wrapping
View: Toggle MinimapShow or hide the code minimap

Selection Commands

CommandDescription
Select AllSelect all content in the file
Expand SelectionIntelligently expand the current selection
Shrink SelectionIntelligently shrink the current selection
Add Cursor AboveAdd a cursor one line above
Add Cursor BelowAdd a cursor one line below
Add Cursors to Line EndsAdd cursors at the end of all selected lines
Select All Occurrences of Find MatchSelect all occurrences matching the find value
Select All Occurrences of Selected TextFind and select all occurrences of the selected text
Add Selection To Next Find MatchAdd selection to the next occurrence of the selected text

AI Commands

CommandDescription
AI: Generate CodeGenerate code from a description
AI: Explain SelectionGet an explanation of the selected code
AI: Optimize SelectionReceive suggestions to optimize the selected code
AI: Fix IssuesDetect and fix problems in the selected code
AI: Generate DocumentationGenerate documentation for the selected code
AI: Generate TestsCreate test cases for the selected code
AI: Convert CodeConvert code from one language to another
AI: Summarize CodeGet a concise summary of the code's functionality
AI: ChatOpen the AI chat interface for conversational assistance
AI: Intent DetectionAnalyze your comments to suggest next steps
AI: Training ModeEnable/disable training mode for AI-related features
CommandDescription
Go to File...Navigate to a file in the current project
Go to Symbol...Navigate to a symbol in the current file
Go to Symbol in Workspace...Navigate to a symbol in the workspace
Go to DefinitionNavigate to the definition of the symbol at the cursor
Go to DeclarationNavigate to the declaration of the symbol at the cursor
Go to ReferencesShow all references to the symbol at the cursor
Go to ImplementationNavigate to the implementation of the symbol at the cursor
Go to Type DefinitionNavigate to the type definition of the symbol at the cursor
Go BackNavigate back to the previous location
Go ForwardNavigate forward to the next location
Go to Line/Column...Navigate to a specific line and column
Go to BracketNavigate to the matching bracket

Debug Commands

CommandDescription
Debug: StartStart debugging
Debug: Start Without DebuggingRun the application without debugging
Debug: StopStop the current debug session
Debug: RestartRestart the current debug session
Debug: ContinueContinue execution to the next breakpoint
Debug: Step OverExecute the current line and move to the next line
Debug: Step IntoEnter the function called at the current execution point
Debug: Step OutExecute the remainder of the current function and return to the caller
Debug: Toggle BreakpointAdd or remove a breakpoint at the current line
Debug: Add Conditional BreakpointAdd a breakpoint with a condition
Debug: Add Function BreakpointAdd a breakpoint triggered when a function is called
Debug: Enable All BreakpointsEnable all breakpoints
Debug: Disable All BreakpointsDisable all breakpoints
Debug: Remove All BreakpointsRemove all breakpoints

Terminal Commands

CommandDescription
Terminal: New TerminalCreate a new terminal instance
Terminal: Split TerminalSplit the current terminal into multiple panes
Terminal: Kill TerminalTerminate the current terminal session
Terminal: ClearClear the terminal content
Terminal: RenameRename the current terminal
Terminal: Focus Next TerminalMove focus to the next terminal instance
Terminal: Focus Previous TerminalMove focus to the previous terminal instance
Terminal: Select Default ShellConfigure the default shell used for new terminals

Extension Commands

CommandDescription
Extensions: Install ExtensionsOpen the extension gallery to find and install extensions
Extensions: Show Installed ExtensionsList all installed extensions
Extensions: Show Recommended ExtensionsShow recommended extensions based on your usage
Extensions: Show Popular ExtensionsShow popular extensions from the marketplace
Extensions: Update All ExtensionsCheck for and install updates for all extensions
Extensions: Enable All ExtensionsEnable all installed extensions
Extensions: Disable All ExtensionsDisable all installed extensions
Extensions: Show Extension LogsView logs for extension activity

Workspace Commands

CommandDescription
Workspaces: Add Folder to WorkspaceAdd another folder to the current workspace
Workspaces: Remove Folder from WorkspaceRemove a folder from the current workspace
Workspaces: Save Workspace As...Save the current workspace configuration
Workspaces: Open Workspace...Open a saved workspace configuration
Workspaces: Duplicate WorkspaceCreate a duplicate of the current workspace in a new window
Workspaces: Close WorkspaceClose the current workspace

Preferences Commands

CommandDescription
Preferences: Open SettingsOpen the user settings editor
Preferences: Open Workspace SettingsOpen workspace-specific settings
Preferences: Open Default SettingsView default settings (read-only)
Preferences: Open Keyboard ShortcutsOpen the keyboard shortcuts editor
Preferences: Open User SnippetsConfigure user-defined code snippets
Preferences: Color ThemeChange the color theme
Preferences: File Icon ThemeChange the file icon theme
Preferences: Configure Language Specific SettingsConfigure settings for a specific language

ThinkCode Specific Commands

CommandDescription
ThinkCode: Check for UpdatesCheck if a new version of ThinkCode is available
ThinkCode: Show Release NotesView the release notes for the current version
ThinkCode: Show AI ModelsDisplay and manage available AI models
ThinkCode: Configure AI SettingsCustomize AI behavior and preferences
ThinkCode: Start Context CollectionBegin collecting project context for AI assistance
ThinkCode: Reset ContextClear the collected context and start fresh
ThinkCode: Export SettingsExport settings to a file for backup or sharing
ThinkCode: Import SettingsImport settings from a file
ThinkCode: View TelemetryView data being collected for telemetry (if enabled)
ThinkCode: Configure ProxySet up network proxy configuration

Custom Commands

ThinkCode supports creating custom commands for your specific workflows. You can define custom commands in your settings or through extensions.

Creating Custom Commands

To create a custom command:

  1. Open the Command Palette (Ctrl+Shift+P / ⌘+Shift+P)
  2. Type "Preferences: Open Keyboard Shortcuts (JSON)"
  3. Add a new entry to define your custom command

Example of a custom command configuration:

{
  "key": "ctrl+alt+t",
  "command": "workbench.action.terminal.newWithCwd",
  "args": {
    "cwd": "${fileDirname}"
  },
  "when": "editorTextFocus"
}

This creates a keyboard shortcut (Ctrl+Alt+T) that opens a new terminal in the directory of the currently focused file.

Tasks

ThinkCode's task system allows you to define and run tasks like building, testing, packaging, or deploying. Tasks can be defined in .vscode/tasks.json and executed through the Command Palette.

Common Task Commands

CommandDescription
Tasks: Run TaskSelect and run a configured task
Tasks: Configure TaskCreate or edit task configurations
Tasks: Restart Running TaskRestart the currently running task
Tasks: Terminate TaskStop the currently running task
Tasks: Run Build TaskRun the default build task
Tasks: Run Test TaskRun the default test task

Accessing the Terminal

ThinkCode includes an integrated terminal that you can use to run CLI commands without leaving the application:

  1. Open the terminal with Ctrl+` (Windows/Linux) or ⌘+` (macOS)
  2. Enter ThinkCode CLI commands directly in the terminal

This integrated approach allows you to combine the power of the command line with the visual interface of ThinkCode.