Codetainer

Codetainer.Keep it contained...

Documentation

InstallationGetting StartAdd a SnippetSearch SnippetsCreate an AccountList SnippetsGet snippets

Documentations

Installation

You can install Codetainer using your preferred package manager:

npm install Codetainer

Or with yarn:

yarn add Codetainer

Getting Started

Once installed globally, you can start using Codetainer from your terminal:

ctn init

This sets up your local snippet storage. Think of it as your snippet vault.

Add a Snippet

Quickly save a snippet with a title, language, and optional tags:

ctn add

You'll be prompted to select language, add tags and paste your code in a code editor window that will open automatically.

List Snippets

Get a list of all saved snippets :

ctn list 

Get Snippets

Get your snippet directly in the console:

ctn get snippet

Copy Snippet

Copy your saved snippets:

ctn copy item

Edit a Snippet

Need to tweak something? Edit snippets by ID or title:

ctn edit snippet "newcontent"

This replaces the content of the snippet.
To Edit complex files more effectively, run:

ctn watch item;

This opens the snippet it a code editor, and allows for linting and formating because Codetainer recognises the language.

Use --r to edit or watch remote item

Import Snippets

Backup a file from the working directory into Codetainer:

ctn import ./my-snippet.py

Accepts local files

ctn import ./my-snippet.py -a mySnippet

Saves the imported snippet with a custom title. If not provided, it uses the file name.

Export all Snippets

Bring back all saved snippets:

ctn export-all

exports all snippets and saves them in the current directory, it also recognises their extensions and saves them in the correct format.

Export Snippets

Bring back a saved snippet as a file into the working directory:

ctn export my-backup

exports this snippet , it also recognises its extensions and saves it.

Delete a Snippet

Remove unwanted snippets permanently:

ctn delete "my snippet title"
codetainer

Codetainer



©Codetainer 2025