Skip to content

Using clidocs

clidocs

Go 1.24+ Windows 11 PowerShell Neovim

Running the program

Janela do terminal
# Opens the default snippets directory (~\clidocs_snippets)
clidocs
# Opens the current directory as the snippets root
clidocs .
# Opens a specific directory
clidocs C:\Users\You\my-snippets
clidocs .\docs\snippets

Commands

CommandDescription
clidocsStart with the splash screen (default snippets directory or browse for another)
clidocs .Open the current directory as the snippets root
clidocs <path>Open a specific directory, skipping the splash screen
clidocs --helpInteractive help with one tab per topic (-h, help)
clidocs --versionPrint the installed version (-v, version)
clidocs --installInstall or update from the latest GitHub release
clidocs --uninstallRemove clidocs from the computer

Interface

Start screen

This is the start screen of the program, shown when you run the clidocs command without arguments. Use Up / Down to choose between opening the default snippets directory or browsing for another directory, Enter to confirm and Ctrl+C to quit.

clidocs start screen

Main screen

This is the main screen of the program, shown after you choose a directory. It is empty on first use: press n in the Folders panel to create your first folder. The bar at the bottom lists the shortcuts of the active panel.

The screen is split into three panels. Tab moves between them and the active panel has a blue border.

PanelWhat it does
FoldersLists the folders and subfolders of the snippets directory. Folders with subfolders show a > marker; favorites show a star.
FilesLists the files of the selected folder with the language tag and the age of each file.
PreviewShows the selected file with syntax highlighting, or rendered Markdown (tables, lists, TODO colors and icons).

Main screen with the three panels

Panels and shortcuts

Global shortcuts

KeyAction
TabNext panel
sJump to the Folders panel
gSync snippets with Git
GEdit the Git configuration
:Open the command console
q / Ctrl+CQuit

Folders panel

Shows the folders of the snippets directory. Moving the cursor updates the Files and Preview panels. Enter on a folder with subfolders enters parent-view: the first row is ~/ (the files of the folder itself) followed by one row per subfolder. Left goes back one level.

Folders panel

KeyAction
Up / k, Down / jMove the cursor
Enter / Right / lOpen the folder (enters parent-view if it has subfolders)
Left / hGo back one level
nNew folder
NNew subfolder inside the selected folder
rRename the selected folder
dDelete the selected folder (confirmation required)
DMulti-delete mode: Space selects, D confirms, Esc cancels
/Search folders recursively
fFavorite / unfavorite the selected folder
FOpen the favorites list
HReturn to the original snippets directory
oShow information about the snippets directory

Files panel

Shows the files of the selected folder. The title shows how many snippets there are. Each row has the language tag, the file name and the folder with the file age.

Files panel

KeyAction
Up / k, Down / jMove the cursor (the Preview updates live)
Enter / eOpen the file in Neovim
nNew file
rRename the selected file
dDelete the selected file (confirmation required)
mMove the file to another folder
cImport a file from anywhere with the file picker
/Filter files by name (supports globs such as *.go)

Preview panel (snippet)

Shows the content of the selected file. Code is highlighted with the GitHub Dark theme and Markdown is rendered with styled headings, lists and tables.

Preview panel

KeyAction
Up / k, Down / jScroll
cCopy the whole file to the clipboard
eEdit the file in Neovim
oOpen the file location in Windows Explorer
zToggle zoom (preview fills the screen)
LToggle line numbers
/Search a word in the file; Enter finds matches, then n / N jump between them

How to use

Create folders and subfolders

  1. Focus the Folders panel.
  2. Press n, type the name and press Enter to create a folder.
  3. Select a folder and press N to create a subfolder inside it.
  4. Esc cancels.

Create folder

To create a subfolder, select the parent folder and press N. The dialog shows which folder the new subfolder will be created in (Inside: Folder1/). Folders that contain subfolders show a > marker in the list.

Create subfolder

Rename a folder

  1. Select the folder in the Folders panel.
  2. Press r. A dialog shows the current name (Current: Folder1/) and an input pre-filled for the new name.
  3. Type the new name and press Enter to confirm, or Esc to cancel.

Rename folder

Favorite a folder

  1. Select the folder in the Folders panel.
  2. Press f. A star appears next to the folder name.
  3. Press f again on the same folder to remove the star.
  4. Press F (capital) to open the favorites list.

Favorite folder

In the favorites list use Up / Down to navigate, Enter to go to the folder, o to open it in Explorer, f to remove it from the favorites and Esc to close.

Favorites list

Delete folders

Select it and press d. A dialog asks for confirmation and warns that the folder and all its contents will be deleted and that this cannot be undone. Press Enter or y to delete, or Esc or n to cancel.

Delete folder

Create files inside a folder

  1. Select a folder and focus the Files panel with Tab.
  2. Press n.
  3. Type the file name (without extension) and press Enter or Tab.
  4. Type the extension (for example go, py, md) and press Enter. The file is created and opened in Neovim.

Create file

Edit files

Press Enter or e on a file (Files panel) or e (Preview panel) to open it in Neovim. Save with :w, quit with :q, or both with :wq. When you return to clidocs the preview is refreshed. In the console, the nvim command shows a Neovim quick reference.

Editing a file in Neovim

Snippet panel after saving

After you save and quit Neovim (:wq), clidocs shows the result right away. The Files panel lists the snippet with its language tag, folder and age, and the Preview panel (the snippet panel) shows the saved content: Markdown is rendered with styled text and links, and code files are syntax highlighted. From here you can scroll, search (/), copy (c), edit again (e) or open the folder (o).

Snippet panel after saving the file

Rename a file

  1. Select the file in the Files panel.
  2. Press r. A dialog shows the current name (Current: File1.md) and an input pre-filled with it, extension included.
  3. Type the new name and press Enter to confirm, or Esc to cancel.

Rename file

Move a file

  1. Select the file in the Files panel.
  2. Press m. A dialog shows the file name and the list of folders and subfolders you can move it to.
  3. Use Up / Down to choose the destination folder. The last entry, Browse external folder..., lets you pick a folder outside the snippets directory.
  4. Press Enter to move the file, or Esc to cancel.

Move file

Import a file

  1. Select the folder that will receive the files and focus the Files panel.
  2. Press c. clidocs opens the Windows file picker (the Windows file explorer window) and shows the message Opening file picker....
  3. In the picker, select one or more files and confirm. They are copied into the current folder (Folder1 in the example).

Import file

Delete files

  1. Select the file in the Files panel.
  2. Press d. A dialog asks Are you sure you want to delete: and shows the file name.
  3. Press Enter or y to delete, or Esc or n to cancel.

Delete file

The / key starts a search in every panel. What it searches depends on which panel is focused.

Available when the Folders panel is focused.

  1. Press /. A search dialog opens and lists the folders, including subfolders.
  2. Type part of a folder name. The list is filtered while you type.
  3. Use Up / Down to choose a result and press Enter to jump to that folder.
  4. Press Esc to close the search without changing anything.

Folder search

Available when the Files panel is focused.

  1. Press /. A search bar replaces the panel title.
  2. Type part of a file name. The file list is filtered while you type and globs such as *.go are supported.
  3. Use Up / Down to move through the results. The Preview panel updates live.
  4. Press Enter to keep the selection, or Esc to cancel and restore the full list.

File search

Available when the Preview panel is focused and a file is loaded. It searches words inside the file content.

  1. Press /. A search bar appears.
  2. Type the word or phrase, including the letter n, and press Enter. Every match is shown in bold green inside the text. In code files the lines with matches are also marked: the current one with an orange arrow and the others with a green dot.
  3. After the first Enter, press n to jump to the next match and N to jump to the previous one.
  4. Press Esc to close the search.

Preview search

Git sync

Press g to sync the snippets directory with a Git repository. The first time, a dialog asks for the remote; G edits the configuration later. Git must be installed.

Console

Press : on the main screen to open the console (Cmdline). Type a command and press Enter. Esc closes the console, and from inside a command screen Esc goes back to the console. Unknown commands show Unknown command and a hint to type cmd.

Console

time

Work hours calculator. Type your start time as HH:MM (for example 08:00) and press Enter. It shows the coffee break, lunch start, lunch end, the normal exit time (8h48 worked) and the maximum exit time (10h worked). Enter goes back to the console.

First, type the start time in the HH:MM field and press Enter to calculate (Esc goes back).

time command input

Then the result is shown. In the example, an entry at 07:01 gives the coffee break at 08:01, lunch from 11:01 to 12:01, the normal exit at 16:49 (8h48 worked) and the maximum exit at 18:01 (10h worked).

time command result

alive

Keeps the computer awake. While this screen is open, clidocs presses the B key every 2 seconds, so the system does not lock or go idle. The keypress goes to the focused window, so keep clidocs focused while it runs. Esc stops it.

whoami

Shows information about the author as if a terminal command was run. Enter opens the website fantodocs.github.io in the browser, and Esc goes back to the console.

whoami command

cmd

Shows the list of the commands available in the console, each one with a short description of what it does. It has two tabs: “Console commands” and “Neovim Quick Reference”. Use ←/→ or Tab to switch tabs, 1/2 to jump directly, and ↑/↓ to scroll. Enter or Esc goes back to the console. The keyboard shortcuts of the panels are in the help panel, opened with ? on the main screen.

cmd command

nvim

Opens the same help as cmd, but directly on the “Neovim Quick Reference” tab. It shows navigation, editing, save and quit, search, commenting and uncommenting several lines, and visual mode. Use ←/→ or Tab to switch to the “Console commands” tab. Enter or Esc goes back to the console.

nvim command

ls and cd

ls opens a floating panel with a tree view of the directories inside the directory currently open in clidocs (up to 3 levels, hidden folders skipped). Use ↑/↓ to scroll. In the panel, type cd <directory> (for example cd Projects or cd Projects/App) and press Enter: the panel closes and the Folders and Files panels show the chosen directory. Esc goes back to the console. In the console, cd <directory> also works directly, and cd .. goes to the parent directory.

ls and cd commands

exit

Closes clidocs completely (quit does the same).

Supported languages

Syntax highlighting uses Chroma with the GitHub Dark theme. Each file shows a colored extension badge.

ExtensionLanguage
.goGo
.pyPython
.tsTypeScript
.jsJavaScript
.tsx / .jsxReact
.rsRust
.csC#
.cpp / .ccC++
.c / .hC
.javaJava
.ktKotlin
.swiftSwift
.sh / .bashShell
.ps1PowerShell
.rbRuby
.phpPHP
.vueVue
.svelteSvelte
.dartDart
.mdMarkdown
.htmlHTML
.cssCSS
.scssSCSS
.jsonJSON
.yaml / .ymlYAML
.tomlTOML
.sqlSQL
.xmlXML
.luaLua
.tf / .hclTerraform
.rR
.ex / .exsElixir
.vimVim Script
.envDotenv
.txt / .confPlain text

Project structure

The project is in transition to Clean Architecture. Because Bubble Tea requires Update/View methods in the same package as the Model, core files stay in the root while auxiliary files were reorganized:

  • Directoryclidocs/
    • Directorycmd/
      • Directoryinstall/ TUI installer
        • …
    • core application files (*.go)
    • console_modals.go
    • file_modals.go
    • folder_modals.go
    • git_modals.go
    • other_modals.go
    • README.md

Dependencies

PackagePurpose
github.com/charmbracelet/bubbleteaTUI framework (Elm architecture)
github.com/charmbracelet/bubblesText input component
github.com/charmbracelet/lipglossLayout and styling
github.com/charmbracelet/glamourMarkdown rendering (GitHub Dark style)
github.com/alecthomas/chroma/v2Syntax highlighting
github.com/atotto/clipboardClipboard write support

To install the dependencies:

Janela do terminal
go mod tidy