Kolo CLI

kolo

kolo [OPTIONS] COMMAND [ARGS]...

trace

Subcommands for working with Kolo traces.

kolo trace [OPTIONS] COMMAND [ARGS]...

compact

Get a compact representation of a specific trace.

Get a concise yet detailed overview of everything that happened in the trace. You will see a tree representation of all function calls (and optionally return values), as well as other relevant information and points of interest in the trace like logs or sql queries.

kolo trace compact [OPTIONS] [TRACE_ID]

Options

--pinned

Show compact representation of all pinned traces

--returns

Include return values in compact representation (warning: can be verbose)

--recent <recent>

Show compact representation of the N most recent traces (default: 5)

Arguments

TRACE_ID

Optional argument

delete

Delete one or more traces stored by Kolo.

kolo trace delete [OPTIONS] [TRACE_IDS]...

Options

--old

Delete old traces.

--before <before>

Delete traces older than this datetime. Must be used with –old.

--vacuum

Recover disk space from the Kolo database.

Arguments

TRACE_IDS

Optional argument(s)

download

Download a trace from the Kolo dashboard

kolo trace download [OPTIONS] TRACE_ID

Arguments

TRACE_ID

Required argument

dump

Dump a trace from the Kolo database to stdout or a specified file.

kolo trace dump [OPTIONS] TRACE_ID

Options

--file <file>

The name of the file to save the trace to.

--as-python

Show the trace as readable Python types.

--syntax-highlight <syntax_highlight>

Highlight Python syntax. Ignored unless –as-python is set.

Options:

off | light | dark

Arguments

TRACE_ID

Required argument

json-to-msgpack

Convert all legacy json traces to msgpack

kolo trace json-to-msgpack [OPTIONS]

list

Concisely list available traces, ordered by most recent first.

This is useful for getting an overview of what traces are available and finding specific traces you might want to analyze further.

After listing the trace, you can use `kolo trace compact <trace_id> to get more details about the trace.

If you’re an LLM, use kolo trace list often to orient yourself.

kolo trace list [OPTIONS]

Options

--count <count>

The number of rows to show.

--reverse

Reverse the order of the rows: newest at the bottom.

list-queries

List all SQL queries in a trace.

kolo trace list-queries [OPTIONS] TRACE_ID

Options

--syntax-highlight <syntax_highlight>

Highlight SQL query syntax.

Options:

off | light | dark

Arguments

TRACE_ID

Required argument

load

Load a trace from a file into the Kolo database.

kolo trace load [OPTIONS] PATH

Options

--created-at <created_at>

Mark this trace as created at this time.

Arguments

PATH

Required argument

node

Get detailed information about a specific node in a trace. This is useful when you need to deeply understand what happened at a specific point in the execution, like examining function arguments, local variables, or the exact line of code being executed.

kolo trace node [OPTIONS] TRACE_ID NODE_INDEX

Arguments

TRACE_ID

Required argument

NODE_INDEX

Required argument

pin

Pin a trace. This includes the trace in the output of using kolo trace compact –pinned, which can be helpful to give an LLM an overview of the key transactions in your project.

kolo trace pin [OPTIONS] TRACE_ID

Arguments

TRACE_ID

Required argument

unpin

Unpin a previously pinned trace.

kolo trace unpin [OPTIONS] TRACE_ID

Arguments

TRACE_ID

Required argument

upload

Upload a trace to the Kolo dashboard

kolo trace upload [OPTIONS] TRACE_ID

Arguments

TRACE_ID

Required argument

generate-test

Generate a test from a Kolo trace.

kolo generate-test [OPTIONS] [TRACE_IDS]...

Options

--test-name <test_name>

The name of the generated test.

--test-class <test_class>

The name of the generated TestCase class.

--file <file>

Write the generated test to this file.

--settings <settings>

The dotted path to a Django settings module.

--use-saved-schemas

Load Django schemas saved with kolo store-django-model-schema instead of using the current schema. This may be useful when generating a test from an old trace.

--intermediate-format

Show an intermediate format of the data Kolo has extracted from the trace for use in the test.

--and-run

[Experimental, Use not recommended] Immediately run the newly generated test.

--unittest

Generate a unittest style test.

--pytest

Generate a pytest style test (default).

Arguments

TRACE_IDS

Optional argument(s)

run

Profile Python code using Kolo.

PATH is the path to the python file or module being profiled.

kolo run [OPTIONS] PATH [ARGS]...

Options

--one-trace-per-test

Generate a trace for each test traced by Kolo.

--use-monitoring

Enable Kolo implementation using sys.monitoring

Arguments

PATH

Required argument

ARGS

Optional argument(s)

dbshell

Open a sqlite3 shell to the Kolo database.

kolo dbshell [OPTIONS]

store-django-model-schema

Store Django model info for test generation.

kolo store-django-model-schema [OPTIONS]

Options

--settings <settings>

The dotted path to a Django settings module.