### Build TaskLite from Source Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/installation.md Compiles TaskLite from its source code. This requires Git and Stack to be installed. After cloning the repository, 'make install' builds and installs the application. ```shell git clone https://github.com/ad-si/TaskLite cd TaskLite make install ``` -------------------------------- ### Start TaskLite Web App (Shell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/web_based_guis/web_app.md Commands to clone the TaskLite repository, navigate to the web app directory, and start the web application server using 'make start'. The web app will be accessible at http://localhost:3000. ```shell git clone https://github.com/ad-si/TaskLite cd TaskLite/tasklite-webapp make start ``` -------------------------------- ### Install TaskLite CLI Source: https://context7.com/ad-si/tasklite/llms.txt Instructions for installing TaskLite via Homebrew, Docker, or building from source. Includes a verification step. ```bash # macOS via Homebrew brew cask install ad-si/tap/tasklite # Docker docker run --rm adius/tasklite sh # From source git clone https://github.com/ad-si/TaskLite cd TaskLite make install # Verify installation tasklite help ``` -------------------------------- ### Start TaskLite Server (Shell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/web_based_guis/web_app.md Command to start the TaskLite GraphQL server. This is a prerequisite for running the web application. ```shell tasklite server ``` -------------------------------- ### Run TaskLite Desktop App Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/desktop_app.md Starts the installed TaskLite native GTK desktop application. This command assumes the application has been successfully built and installed. ```shell tasklite-app ``` -------------------------------- ### Start TaskLite Web Application Source: https://context7.com/ad-si/tasklite/llms.txt Instructions to start the TaskLite web application, typically run in a separate terminal. After starting, the web app is accessible at http://localhost:3000. ```bash # Start the web app (in separate terminal) cd tasklite-webapp make start # Web app available at http://localhost:3000 ``` -------------------------------- ### Start TaskLite GraphQL Server Source: https://context7.com/ad-si/tasklite/llms.txt Command to start the TaskLite GraphQL API server. This enables programmatic access and management of tasks through a GraphQL interface. ```bash # Start the GraphQL server tasklite server ``` -------------------------------- ### Install TaskLite using Homebrew (macOS) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/installation.md Installs TaskLite on macOS using the Homebrew package manager. This is a convenient way to manage installations and updates. ```shell brew cask install ad-si/tap/tasklite ``` -------------------------------- ### Clone and Install TaskLite GTK App Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/desktop_app.md Clones the TaskLite repository and installs the tasklite-app using Stack. This process builds the native GTK desktop application. ```shell git clone https://github.com/ad-si/TaskLite cd TaskLite stack install tasklite-app ``` -------------------------------- ### Run SQLite Web with Docker for TaskLite Source: https://github.com/ad-si/tasklite/blob/main/docs-source/web_based_guis/sqlite_web_frontends.md Starts the SQLite Web interface using Docker, mapping the local TaskLite database directory to the container and exposing the web interface on port 8080. This method requires Docker to be installed and configured. It allows for web-based management and querying of the SQLite database. ```sh docker run -it --rm \ -p 8080:8080 \ -v ~/TaskLite:/data \ -e SQLITE_DATABASE=main.db \ coleifer/sqlite-web ``` -------------------------------- ### Install GTK Dependencies on macOS Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/desktop_app.md Installs the required GTK+3 and related development libraries on macOS using Homebrew. These are essential for building the native GTK application. ```shell brew install \ gtk+3 \ libffi \ gobject-introspection \ gdk-pixbuf ``` -------------------------------- ### Add Tasks with Custom Shortcuts Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Demonstrates adding tasks using custom shortcuts defined in the configuration file. This includes examples with prefixes, single tags, multiple tags, and no tags. ```shell tl cook dinner tl call Mom tl fix login bug tl shopping milk tl quick something ``` -------------------------------- ### V Script: Post Launch Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md This V script handles the post-launch hook. It reads JSON input from stdin, parses arguments, and prints a JSON output with status messages. ```v import os import json struct PostLaunchInput { mut: arguments []string } struct PostLaunchOutput { message string warning string error string } fn main() { stdin := os.get_raw_lines_joined() mut input := json.decode(PostLaunchInput, stdin)! println(json.encode(PostLaunchOutput{ message: '📜 Post launch message\n' + // 'Provided arguments: ${input.arguments}\n' warning: '⚠️ Post-launch warning' error: '❌ Post-launch error' })) } ``` -------------------------------- ### Run TaskLite using Docker Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/installation.md Executes TaskLite within a Docker container. The first command runs a temporary container to show help, while the second mounts a local path for persistent data. ```shell docker run --rm adius/tasklite sh tasklite help ``` ```shell docker run \ --rm \ --volume "$TASKLITE_PATH":/root/.local/share/tasklite \ adius/tasklite ``` -------------------------------- ### V Script: Pre Launch Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md A simple V script for the pre-launch hook that prints a JSON object containing message, warning, and error strings. ```v fn main() { println('{ "message": "📜 Pre launch message", "warning": "⚠️ Pre launch warning", "error": "❌ Pre launch error" }') } ``` -------------------------------- ### Configure TaskLite Hooks (YAML) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md This YAML configuration defines the directory for hook scripts and specifies pre-launch commands, including a V script interpreter and its body. ```yaml hooks: directory: /Users/adrian/Dropbox/TaskLite/hooks launch: pre: - interpreter: v body: | fn main() { println('{ "message": "📜 Pre launch message", "warning": "⚠️ Pre launch warning", "error": "❌ Pre launch error" }') } post: [] add: pre: [] post: [] modify: pre: [] post: [] exit: pre: [] ``` -------------------------------- ### Extracting GitHub URL to Metadata with SQL Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Provides an SQL example for automatically extracting GitHub links from a task's 'body' and storing them in a 'github_url' metadata field. It handles cases where the URL is at the end of the body or followed by a space. ```sql UPDATE tasks SET metadata = json_insert( ifnull(metadata, '{}'), '$.github_url', substr(body, instr(body, 'https://github.com'), CASE WHEN instr(substr(body, instr(body, 'https://github.com')), ' ') == 0 THEN length(substr(body, instr(body, 'https://github.com'))) ELSE instr(substr(body, instr(body, 'https://github.com')), ' ') - 1 END ) ) WHERE body LIKE '%https://github.com%' ``` -------------------------------- ### TaskLite External Command Example Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Demonstrates how to create and use an external command for TaskLite. A bash script named 'tasklite-grin' is created, made executable, and then called from the command line, showing its output. ```bash $ cat /usr/local/bin/tasklite-grin #! /usr/bin/env bash echo '😁' "$@" $ tasklite grin Hi 😁 Hi ``` -------------------------------- ### Access Tasks by Tag via Web Interface Source: https://context7.com/ad-si/tasklite/llms.txt Examples of URLs to access tasks filtered by specific tags within the TaskLite web application. This demonstrates how to navigate and view tasks based on their tags. ```bash # Access tasks by tag via web # http://localhost:3000/tags/work # http://localhost:3000/tags/chore ``` -------------------------------- ### List and Filter Tasks with TaskLite CLI Source: https://context7.com/ad-si/tasklite/llms.txt Examples of listing all tasks, newest tasks, tasks without tags, and filtering tasks by tag, state, due date, or a combination of criteria. Includes random task selection. ```bash # List all open tasks tl # List all tasks (including closed) tl all # List newest tasks tl new # List tasks without tags (inbox) tl notag # Show random task tl random # Filter by tag tl get +chore # Filter by state tl get state:done # Filter by due date tl get due:2024-01-01 # Combined filters tl get +chore state:open # Filter with random tl random +chore # List open tasks with specific tag tl open +work ``` -------------------------------- ### Export Tasks in NDJSON Format and Process with `jq` Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Exports all tasks in NDJSON format and pipes the output to `jq` for processing. This example demonstrates sorting tasks by the number of tags, showing advanced data manipulation capabilities. ```bash tl ndjson \ | jq --raw-output '(.tags | length | tostring) + " " + .ulid' \ | sort --numeric-sort --reverse ``` -------------------------------- ### Composing TaskLite with 'tu' for Fuzzy Dates (Fish Shell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/concepts/main.md Provides an example of using TaskLite with the 'tu' CLI tool within the Fish shell for managing fuzzy date inputs. This showcases a slightly more concise syntax available in Fish for similar functionality as standard shell composition. ```fish tl add Buy milk due:(tu in 2 weeks) ``` -------------------------------- ### Filter Tasks Using `tl get` Command Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Filters and lists tasks based on various criteria, including tags, state, and due dates. The `tl get` command supports a flexible filter language for precise task retrieval. ```shell tl get +chore tl get state:done tl get due:2013-01-01 tl get +chore state:done ``` -------------------------------- ### Manage Recurring Tasks with TaskLite CLI Source: https://context7.com/ad-si/tasklite/llms.txt Examples for creating repeating tasks (offset from completion) and recurring tasks (fixed schedule), removing recurrence, and listing all recurring tasks. ```bash # Create a repeating task (offset from completion time) tl add Mow the lawn due:2024-10-01 tl repeat P1M 01eme2w9pqbmgme5zcwr9hpfbc # When completed, creates new task due 1 month from completion date # Create a recurring task (fixed schedule) tl add Pay rent due:2024-10-01 tl recur P1M 01eme47dje7bpkmz01s5xdtw15 # When completed, creates new task due on the 1st of next month # Remove recurrence tl unrecur 01eme47dje7bpkmz01s5xdtw15 # List all recurring tasks tl recurring ``` -------------------------------- ### Pre Launch: Shell Script for Pre-Launch Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md This shell script is designed for the 'pre-launch' hook. It reads all input from standard input, prints it to standard error for debugging, and then outputs an empty JSON object. This is useful for inspecting data passed to the hook before the launch process. ```sh stdin=$(cat) >&2 echo "File > pre-launch: Input via stdin:" >&2 echo "$stdin" echo "{}" ``` -------------------------------- ### Create Custom TaskLite Command (Bash) Source: https://context7.com/ad-si/tasklite/llms.txt An example of creating a custom TaskLite command named 'standup'. This bash script, when placed in the system's PATH and made executable, displays today's work tasks and tasks completed yesterday. ```bash # Create custom command: /usr/local/bin/tasklite-standup #!/usr/bin/env bash echo "=== Today's Tasks ===" tasklite query "tags like '%work%' and closed_utc is null order by priority desc limit 5" echo "" echo "=== Completed Yesterday ===" tasklite query "closed_utc >= date('now', '-1 day') and tags like '%work%'" # Make executable chmod +x /usr/local/bin/tasklite-standup ``` -------------------------------- ### V Script: Pre Exit Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md A V script for the pre-exit hook that simply prints a JSON object containing message, warning, and error strings. ```v fn main() { println('{ "message": "📜 Pre exit message", "warning": "⚠️ Pre exit warning", "error": "❌ Pre exit error" }') } ``` -------------------------------- ### TaskLite Hooks Configuration (YAML) Source: https://context7.com/ad-si/tasklite/llms.txt A YAML configuration file snippet for setting up TaskLite hooks. It specifies the directory for hook scripts and defines actions to be launched before TaskLite starts, printing a message to the console. ```yaml # Config file hooks configuration hooks: directory: /Users/username/TaskLite/hooks launch: pre: - interpreter: lua body: | print('{"message": "TaskLite starting"}') add: pre: [] post: [] modify: pre: [] post: [] ``` -------------------------------- ### V Script: Post Add Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md The post-add hook script in V. It receives details of the added task and arguments via JSON from stdin and outputs status messages. ```v import os import json struct Task { mut: body string tags []string } struct PostAddInput { mut: arguments []string task_added Task @[json: 'taskAdded'] } struct PostAddOutput { mut: message string warning string error string } fn main() { stdin := os.get_raw_lines_joined() mut input_data := json.decode(PostAddInput, stdin)! post_add_output := PostAddOutput{ message: '📜 Post-add message\n' + // 'Provided arguments: ${input_data.arguments.str()}\n' + // 'Added task: ${input_data.task_added.str()}\n' warning: '⚠️ Post-add warning' error: '❌ Post-add error' } println(json.encode(post_add_output)) } ``` -------------------------------- ### Tasklite: Add and Recur a Task Source: https://github.com/ad-si/tasklite/blob/main/docs-source/concepts/repetition_and_recurrence.md This example demonstrates adding a task in Tasklite and setting it to recur monthly. The 'recur' command ensures that missed tasks are caught up immediately, maintaining a fixed schedule. ```bash $ tl add Pay rent due:2020-10-01 🆕 Added task "Pay rent" with id "01eme47dje7bpkmz01s5xdtw15" $ tl recur P1M 01eme47dje7bpkmz01s5xdtw15 📅 Set recurrence duration of task "Pay rent" with id "01eme47dje7bpkmz01s5xdtw15" to "P1M" $ tl info 01eme47dje7bpkmz01s5xdtw15 Pay rent State: Open Priority: 12.0 ULID: 01eme47dje7bpkmz01s5xdtw15 📅 Due 2020-10-01 00:00:00 ⬇ 🆕 Created 2020-10-12 10:03:21 ⬇ ✏️ Modified 2020-10-12 10:03:32 Recurrence Duration: P1M Group Ulid: 01eme47s0yy848wvbsyxh9mpj6 User: adrian $ tl do 01eme47dje7bpkmz01s5xdtw15 ✅ Finished task "Pay rent" with id "01eme47dje7bpkmz01s5xdtw15" ➡️ Created next task "Pay rent" in recurrence series "01eme47s0yy848wvbsyxh9mpj6" with id "01eme487qmxj7jm4mtn5n59nbg" $ tl info 01eme487qmxj7jm4mtn5n59nbg Pay rent State: Open Priority: 3.0 ULID: 01eme487qmxj7jm4mtn5n59nbg ✏️ Modified 2020-10-12 10:03:32 ⬇ 🆕 Created 2020-10-12 10:03:47 ⬇ 📅 Due 2020-11-01 00:00:00 Recurrence Duration: P1M Group Ulid: 01eme47s0yy848wvbsyxh9mpj6 User: adrian ``` -------------------------------- ### Tasklite: Add and Repeat a Task Source: https://github.com/ad-si/tasklite/blob/main/docs-source/concepts/repetition_and_recurrence.md This example shows how to add a new task in Tasklite and then set it to repeat at a monthly interval. The 'repeat' command calculates the next due date based on the completion date of the current task. ```bash $ tl add Mow the lawn due:2020-10-01 🆕 Added task "Mow the lawn" with id "01eme2w9pqbmgme5zcwr9hpfbc" $ tl repeat P1M 01eme2w9pqbmgme5zcwr9hpfbc 📅 Set repeat duration of task "Mow the lawn" with id "01eme2w9pqbmgme5zcwr9hpfbc" to "P1M" $ tl info 01eme2w9pqbmgme5zcwr9hpfbc Mow the lawn State: Open Priority: 12.0 ULID: 01eme2w9pqbmgme5zcwr9hpfbc 📅 Due 2020-10-01 00:00:00 ⬇ 🆕 Created 2020-10-12 09:39:48 ⬇ ✏️ Modified 2020-10-12 09:39:58 Repetition Duration: P1M Group Ulid: 01eme2wm3e4wcwacnw9ha7ffs1 User: adrian $ tl do 01eme2w9pqbmgme5zcwr9hpfbc ✅ Finished task "Mow the lawn" with id "01eme2w9pqbmgme5zcwr9hpfbc" ➡️ Created next task "Mow the lawn" in repetition series "01eme2wm3e4wcwacnw9ha7ffs1" with id "01eme2xe4vjv3yd3gkg0a9y8j8" $ tl info 01eme2xe4vjv3yd3gkg0a9y8j8 Mow the lawn State: Open Priority: 3.0 ULID: 01eme2xe4vjv3yd3gkg0a9y8j8 ✏️ Modified 2020-10-12 09:39:58 ⬇ 🆕 Created 2020-10-12 09:40:25 ⬇ 📅 Due 2020-11-12 09:39:58 Repetition Duration: P1M Group Ulid: 01eme2wm3e4wcwacnw9ha7ffs1 User: adrian ``` -------------------------------- ### Pre Add: Shell Script for Pre-Add Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md This shell script is designed for the 'pre-add' hook. It reads all data from standard input, prints it to standard error for inspection, and then outputs an empty JSON object. This allows for examining data before a task is added. ```sh stdin=$(cat) >&2 echo "File > pre-add: Input via stdin:" >&2 echo "$stdin" echo "{}" ``` -------------------------------- ### V Script: Pre Add Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md This V script implements the pre-add hook. It parses task details and arguments from JSON input, modifies the task by adding a tag, and outputs the updated task and status messages. ```v import os import json struct Task { mut: body string tags []string } struct PreAddInput { mut: task_to_add Task @[json: 'taskToAdd'] arguments []string } struct PreAddOutput { mut: task Task message string warning string error string } fn main() { stdin := os.get_raw_lines_joined() input_data := json.decode(PreAddInput, stdin)! mut task := input_data.task_to_add task.tags << 'additional-tag' pre_add_output := PreAddOutput{ task: task message: '📜 Pre-add message\n' + // 'Provided arguments: ${input_data.arguments.str()}\n' + // 'Provided task: ${input_data.task_to_add.str()}\n' + // 'Updated task: ${task.str()}\n' warning: '⚠️ Pre-add warning' error: '❌ Pre-add error' } println(json.encode(pre_add_output)) } ``` -------------------------------- ### Post Launch: Shell Script for Post-Launch Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md This shell script is intended for the 'post-launch' hook. It reads all input from standard input, echoes it to standard error for logging purposes, and then outputs an empty JSON object. This script can be used to process or log data after a launch event. ```sh stdin=$(cat) >&2 echo "File > post-launch: Input via stdin:" >&2 echo "$stdin" echo "{}" ``` -------------------------------- ### Upload GitHub Stats using Airput CLI Source: https://github.com/ad-si/tasklite/blob/main/docs-source/related.md This command-line interface (CLI) command uses Airput to upload GitHub repository statistics. It requires authentication tokens for both Airput and GitHub. The command uploads stats for multiple repositories, indicated by the '...' at the end. ```sh AIRSEQUEL_DB_ID='01…' \ AIRSEQUEL_API_TOKEN='ast_…' \ GITHUB_TOKEN='ghp_…' \ airput github-upload ad-si/TaskLite && \ airput github-upload xwmx/nb && \ airput github-upload jarun/Buku && \ … ``` -------------------------------- ### Post Add: Automatically Add 'music' Tag Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md This Lua script automatically adds a 'music' tag to a task if it already has the 'jazz' tag. It reads task data from stdin, checks for the 'jazz' tag, and then uses the TaskLite CLI to add the 'music' tag. It prints a confirmation message upon successful addition. ```lua stdin = io.read("*all") data = tl.json.decode(stdin) if data.taskAdded.tags == tl.json.null then return end for _, tag in ipairs(data.taskAdded.tags) do if tag == "jazz" then local handle = io.popen( "tasklite tag music " .. data.taskAdded.ulid, "r" ) if handle then handle:read("*a") handle:close() end print(tl.json.encode({message = "Added music tag"})) return end end ``` -------------------------------- ### Import Google Keep JSON tasks to TaskLite Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/import.md Import tasks exported from Google Keep via Google Takeout. This script uses `jq` to parse the JSON files, transforming Keep note structure (title, content, labels, state) into TaskLite's format, including nested sub-tasks as GitHub Flavored Markdown task lists. Each processed task is then imported using `tasklite importjson`. ```bash find . -iname '*.json' \ | while read -r task do jq -c \ '.textContent as $txt | .labels as $lbls | .title as $title | (if .isArchived then "done" elif .isTrashed then "deletable" else null end) as $state | { utc: .userEditedTimestampUsec, body: ((if $title and $title != "" then $title else $txt end) + (if .listContent then "\n\n" + ( .listContent | map("- [" + (if .isChecked then "x" else " " end) + "] " + .text) | join("\n") ) else "" end)) } | if $lbls then . + {tags: ($lbls | map(.name))} else . end | if $title and $title != "" and $txt and $txt != "" then . + {notes: [{body: $txt}]} else . end | if $state then . + {state: $state} else . end ' \ "$task" | tl importjson done ``` -------------------------------- ### Build, Push, Deploy, and Port Forward (Fish Shell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/development.md This comprehensive command sequence in Fish shell automates the build and push of an Nginx proxy Docker image, replaces the Kubernetes deployment, and forwards a port from the TaskLite pod. ```fish docker build \ --file dockerfiles/nginx-proxy \ --tag gcr.io/deploy-219812/nginx-proxy:latest \ dockerfiles; \ and docker push gcr.io/deploy-219812/nginx-proxy:latest; \ and kubectl replace --filename kubernetes/deployment.yaml --force; \ and sleep 8; and kubectl port-forward \ (kubectl get pods --selector app=tasklite --output name) 8080 ``` -------------------------------- ### Run Datasette for TaskLite SQLite Database Source: https://github.com/ad-si/tasklite/blob/main/docs-source/web_based_guis/sqlite_web_frontends.md Launches the Datasette web server, providing a web frontend for exploring the specified SQLite database. This allows for interactive querying and viewing of data through a web browser. No external dependencies beyond Datasette itself are required. ```sh datasette ~/TaskLite/main.db ``` -------------------------------- ### Display Help Information Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Displays a comprehensive overview of all available subcommands and their usage for the TaskLite CLI. This is the primary command to understand the tool's capabilities. ```shell tasklite help ``` -------------------------------- ### V Script: Post Modify Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md The post-modify hook script in V. It receives information about the modified task and arguments via JSON from stdin and outputs status messages. ```v import os import json struct Task { mut: body string tags []string } struct PostModifyInput { mut: arguments []string task_modified Task @[json: 'taskModified'] } struct PostModifyOutput { mut: message string warning string error string } fn main() { stdin := os.get_raw_lines_joined() mut input_data := json.decode(PostModifyInput, stdin)! post_modify_output := PostModifyOutput{ message: '📜 Post-modify message\n' + // 'Provided arguments: ${input_data.arguments.str()}\n' + // 'Modified task: ${input_data.task_modified.str()}\n' warning: '⚠️ Post-modify warning' error: '❌ Post-modify error' } println(json.encode(post_modify_output)) } ``` -------------------------------- ### TaskLite Configuration File (YAML) Source: https://context7.com/ad-si/tasklite/llms.txt A sample TaskLite configuration file in YAML format. It defines settings such as the table name, displayed columns, styling for various elements, date formats, database name, and custom shortcuts for tasks. ```yaml tableName: tasks # Columns displayed in task listings columns: [id, prio, openedUtc, age, due, tags, body] # Styling idWidth: 4 idStyle: green priorityStyle: magenta dateStyle: dull black bodyStyle: white tagStyle: blue dueStyle: yellow overdueStyle: red # Date formats utcFormat: YYYY-MM-DD H:MI:S utcFormatShort: YYYY-MM-DD H:MI # Display settings dbName: main.db headCount: 20 maxWidth: 120 tagsWidth: 20 # Custom shortcuts shortcuts: cook: prefix: Cook tag: cook call: prefix: Call tag: call shopping: prefix: Buy tags: [shopping, errands] ``` -------------------------------- ### Inspecting Task Metadata with tl info Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Illustrates how to inspect a task's details, including its metadata, using the 'tl info' command followed by the task's ULID. The 'metadata' section shows the 'kanban-state' field preserved from the import. ```bash $ tl info 01e0k6a1p00002zgzc0845vayw awake_utc: null review_utc: null state: null repetition_duration: null recurrence_duration: null body: Buy milk user: adrian ulid: 01e0k6a1p00002zgzc0845vayw modified_utc: 1970-01-01T00:00:00Z group_ulid: null closed_utc: null priority_adjustment: null metadata: body: Buy milk kanban-state: backlog created_at: 2020-02-08T20:02:32Z waiting_utc: null ready_utc: null due_utc: null priority: 0.0 tags: notes: ``` -------------------------------- ### Import Taskwarrior tasks to TaskLite Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/import.md Migrate tasks from Taskwarrior to TaskLite by exporting Taskwarrior tasks and piping the output to `tasklite importjson`. This leverages Taskwarrior's export format, which is compatible with TaskLite. ```bash task export | tasklite importjson ``` -------------------------------- ### Docker Image Tagging and Pushing (Shell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/development.md These commands are used for deploying the TaskLite application to Google Cloud. They involve tagging a local Docker image with a GCR repository path and then pushing it to the registry. ```sh docker tag adius/tasklite-tasklite:latest gcr.io/deploy-219812/tasklite:latest docker push gcr.io/deploy-219812/tasklite:latest ``` -------------------------------- ### V Script: Pre Modify Hook Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/examples.md This V script is for the pre-modify hook. It takes task details and arguments from JSON input, modifies the task by adding a tag, and returns the modified task along with status messages. ```v import os import json struct Task { mut: body string tags []string } struct PreModifyInput { mut: arguments []string task_to_modify Task @[json: 'taskToModify'] } struct PreModifyOutput { mut: task Task message string warning string error string } fn main() { stdin := os.get_raw_lines_joined() input_data := json.decode(PreModifyInput, stdin)! mut task := input_data.task_to_modify task.tags << 'additional-tag' pre_modify_output := PreModifyOutput{ task: task // TODO: This should be parsed by TaskLite and used downstream message: '📜 Pre-modify message\n' + // 'Provided arguments: ${input_data.arguments.str()}\n' + // 'Provided task: ${input_data.task_to_modify.str()}\n' + // 'Updated task: ${task.str()}\n' warning: '⚠️ Pre-modify warning' error: '❌ Pre-modify error' } println(json.encode(pre_modify_output)) } ``` -------------------------------- ### Add Tasks with TaskLite CLI Source: https://context7.com/ad-si/tasklite/llms.txt Demonstrates adding new tasks with various options including tags, due dates, creation dates, and using built-in shortcuts for common task types. ```bash # Basic task tl add Buy milk # Output: 🆕 Added task "Buy milk" with id "01dd62xryn5fnzjgynkcy06spb" # With tags tl add Improve the TaskLite manual +tasklite +documentation # With due date and creation date tl add Buy groceries +shopping due:2024-12-01 created:2024-11-15 # Using built-in shortcuts tl write "Email to John" # Adds "Write Email to John +write" tl read "Haskell book" # Adds "Read Haskell book +read" tl idea "New feature" # Adds "New feature +idea" tl buy "Coffee beans" # Adds "Buy Coffee beans +buy" ``` -------------------------------- ### Run TaskLite CLI Command (Haskell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/development.md This command demonstrates how to run the TaskLite application locally from the command line using Stack. It is used to test CLI interactions, such as adding a new task. ```sh stack run -- add "Buy milk" ``` -------------------------------- ### Convert Telegram JSON to YAML Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/import.md Convert Telegram 'Saved Messages' JSON export to YAML format for easier manual cleanup before importing into TaskLite. This uses `jq` to select the messages array and `yq` to perform the conversion to YAML. ```bash jq '.messages' result.json | yq --yaml-output > out.yaml ``` -------------------------------- ### Adding a Task and a Note with TaskLite (Text Output) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/concepts/main.md Illustrates the command-line interaction for adding a new task and subsequently adding a note to that task using TaskLite. The output shows the confirmation messages and the detailed information of the task including its notes. ```txt $ tl add Buy milk 🆕 Added task "Buy milk" with id "01dpgj8e9ws2dwgvsk5nmrvvg9" $ tl note 'The vegan one from Super Buy' 01dpgj8e9ws2dwgvsk5nmrvvg9 🗒 Added a note to task "Buy milk" with id "01dpgj8e9ws2dwgvsk5nmrvvg9" $ tl info 01dpgj8e9ws2dwgvsk5nmrvvg9 awake_utc: null review_utc: null state: null repetition_duration: null recurrence_duration: null body: Buy milk user: adrian ulid: 01dpgj8e9ws2dwgvsk5nmrvvg9 modified_utc: 2019-10-06 12:59:46 group_ulid: null closed_utc: null priority_adjustment: null metadata: null waiting_utc: null ready_utc: null due_utc: null priority: 1.0 tags: notes: - note: The vegan one from Super Buy ulid: 01dpgjf35pq74gchsgtcd6fgsa ``` -------------------------------- ### Import YAML tasks to TaskLite Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/import.md Import tasks directly from a YAML file into TaskLite using the `tasklite importyaml` command. For more granular control, tasks can be processed individually using `yaml2json` and `jq` to pipe each task as JSON to `tasklite importjson`. ```bash cat tasks.yaml | tasklite importyaml ``` ```bash cat tasks.yaml \ | yaml2json \ | jq -c '.[]' \ | while read -r task do echo "$task" | tasklite importjson done ``` -------------------------------- ### List All Tasks Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Lists all tasks currently stored in TaskLite. This is a basic command for viewing the entire task list. ```shell tl all ``` -------------------------------- ### Accessing Metadata with SQL Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Shows how to retrieve a specific metadata field ('kanban-state') using TaskLite's 'runsql' command. This leverages SQL's JSON functions to query the 'metadata' column. ```sql $ tl runsql " SELECT json_extract(metadata, '\$.kanban-state') FROM tasks WHERE ulid == '01e0k6a1p00002zgzc0845vayw' " \ | tail -n 1 backlog ``` -------------------------------- ### Configure PKG_CONFIG_PATH for libffi (Fish Shell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/desktop_app.md Sets the PKG_CONFIG_PATH environment variable in the Fish shell to include the libffi package configuration. This may be necessary for the build process to locate libffi. ```fish set -x PKG_CONFIG_PATH /usr/local/opt/libffi/lib/pkgconfig ``` -------------------------------- ### Kubernetes Deployment and Port Forwarding (Shell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/development.md These commands manage the deployment of TaskLite on Kubernetes. They include creating a deployment and forwarding a local port to the service running in the cluster. ```sh kubectl create -f kubernetes/deployment.yaml kubectl port-forward tasklite-deployment-77884ff4f6-66sjf 8001 ``` -------------------------------- ### Debugging TaskLite ndjson Output (Shell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/main.md This shell command demonstrates how to debug TaskLite's ndjson output for a specific task. It pipes the output to `grep` to filter by a task's ULID, then uses `head` to get the first line, and finally `jq` to pretty-print the JSON. ```shell tl ndjson | grep $ULID_OF_TASK | head -n 1 | jq ``` -------------------------------- ### Execute SQL Queries with TaskLite CLI Source: https://context7.com/ad-si/tasklite/llms.txt Shows how to run custom SQL queries directly against the TaskLite SQLite database for advanced data retrieval and reporting. ```bash # Run custom SQL query tl runsql "SELECT body, priority FROM tasks WHERE state IS NULL ORDER BY priority DESC LIMIT 5" ``` -------------------------------- ### Import and Export Tasks with TaskLite CLI Source: https://context7.com/ad-si/tasklite/llms.txt Demonstrates importing tasks from Taskwarrior, GitHub issues, and YAML files. Shows exporting tasks as CSV, NDJSON, and Taskwarrior format, as well as creating backups. ```bash # Import from Taskwarrior task export | tasklite importjson # Import GitHub issue curl https://api.github.com/repos/owner/repo/issues/123 | tl import # Import YAML file cat tasks.yaml | tasklite importyaml # Export as CSV tl csv > tasks.csv # Export as NDJSON tl ndjson > tasks.ndjson # Export in Taskwarrior format tl tw > tasks.ndjson task import tasks.ndjson # Create backup tl backup # Creates ~/TaskLite/backups/YYYY-MM-DDtHHMM.db ``` -------------------------------- ### Import Apple Reminders using osascript Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/import.md This snippet shows how to export reminders from Apple Reminders using an AppleScript and import them into TaskLite. It requires downloading the 'export-reminders.scpt' script and running it via the command line. The output is then saved to a JSON file and imported using the 'tasklite importjson' command. ```shell osascript export-reminders.scpt ``` ```bash cat tasks.json | tasklite importjson ``` ```bash cat tasks.json \ | jq -c '.[]' \ | while read -r task do echo $task | tasklite importjson done ``` -------------------------------- ### Import Telegram JSON messages to TaskLite Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/import.md Import 'Saved Messages' from Telegram by exporting the chat history as JSON. This script uses `jq` to process the Telegram JSON, extracting message text and date to format them as TaskLite tasks, tagging them with 'telegram'. Each formatted task is then piped to `tasklite importjson`. ```bash cat result.json \ | jq -c \ '.messages | map( (if (.text | type) == "string" then .text else (.text | map( if (. | type) == "string" then . else .text end ) | join(", ") ) end) as $body | { utc: .date, body: $body, tags: ["telegram"] } ) | .[] ' | while read -r task do echo "$task" | tasklite importjson done ``` -------------------------------- ### Configure Custom Task Shortcuts Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Defines custom shortcuts in the TaskLite configuration file (YAML format). These shortcuts allow users to specify custom prefixes and tags for adding tasks, enhancing workflow efficiency. ```yaml shortcuts: cook: prefix: Cook tag: cook call: prefix: Call tag: call fix: tag: fix # No prefix, just adds the tag shopping: prefix: Buy tags: [shopping, errands] # Multiple tags quick: prefix: Do tags: [] # No tags, just the prefix ``` -------------------------------- ### Fix TaskLite import mistakes with a fish script Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/import.md This fish shell script helps fix mistakes made during TaskLite imports, specifically when the 'closed_utc' field was incorrectly set. It queries a SQLite database for tasks closed on a specific date, extracts the correct 'end' timestamp from metadata in a backup database, copies it to the clipboard, and then opens the task for manual editing. ```fish sqlite3 \ ~/TaskLite/main.db \ "SELECT ulid FROM tasks WHERE closed_utc LIKE '%2024-02-26%'" \ | while read ulid \ ; echo "$ulid" \ ; and \ sqlite3 \ ~/TaskLite/backups/2024-02-14t1949.db \ "SELECT json_extract(metadata, '\$.end') FROM tasks WHERE ulid == '$ulid'" \ | tee /dev/tty \ | pbcopy \ ; and tl edit "$ulid" \ ; end ``` -------------------------------- ### Accessing Metadata with jq Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Demonstrates how to extract a specific metadata field ('kanban-state') from a task using a pipeline of TaskLite commands ('tl ndjson'), filtering ('grep'), and the 'jq' utility. This method is useful for programmatic access. ```bash $ tl ndjson \ | grep 01e0k6a1p00002zgzc0845vayw \ | jq -r '.metadata["kanban-state"]' backlog ``` -------------------------------- ### Use Built-in Task Shortcuts Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Utilizes predefined shortcuts to quickly add tasks with common prefixes and tags. These shortcuts streamline the process of adding frequently used task types. ```shell tl write "Email to John" tl read "Article about Haskell" tl idea "New feature" tl watch "Haskell tutorial" tl listen "Podcast episode" tl buy "Groceries" tl sell "Old laptop" tl pay "Electric bill" tl ship "Package to Mom" ``` -------------------------------- ### Add Task with Due and Creation Dates Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Adds a task with specific metadata, including tags and date fields like 'due' and 'created'. This showcases how to include structured information when adding tasks. ```shell tl add Buy milk +groceries due:2020-09-01 created:2020-08-27 ``` -------------------------------- ### Composing TaskLite with 'tu' for Fuzzy Dates (Shell) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/concepts/main.md Demonstrates how to integrate TaskLite with the 'tu' CLI tool to handle fuzzy date inputs for task creation. This leverages the Unix philosophy of composing small tools for greater functionality. The output is a shell command that adds a task with a due date calculated by 'tu'. ```sh tl add Buy milk due:$(tu in 2 weeks) ``` -------------------------------- ### Create Custom TaskLite View with CSVKit Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Demonstrates creating a custom view of TaskLite tasks using a pipeline of CLI tools. It exports tasks in CSV format using `tl csv`, filters them by the 'tasklite' tag using `csvgrep`, selects specific columns (`ulid`, `body`, `tags`) using `csvcut`, and formats the output for readability with `csvlook`. This showcases advanced data manipulation capabilities. ```sh tl csv \ | csvgrep --column tags --match tasklite \ | head -n 6 \ | csvcut --columns ulid,body,tags \ | csvlook --max-column-width 30 ``` -------------------------------- ### List Newest Tasks Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Lists tasks sorted by their creation date in descending order (newest first). Useful for quickly seeing recently added tasks. ```shell tl new ``` -------------------------------- ### Create Custom Work View with TaskLite CLI Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Defines a custom 'work' command using a bash script to query TaskLite for tasks related to work. It filters tasks by tags, ensures they are not closed, orders them by priority and due date, and limits the results to 10. This demonstrates the flexibility of TaskLite's SQL query API for creating custom views. ```bash #! /usr/bin/env bash tasklite query \ "(tags is null or tags like '%work%') \ and closed_utc is null \ order by priority desc, due_utc asc, ulid desc \ limit 10" ``` -------------------------------- ### Add a New Task Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/usage.md Adds a new task to the TaskLite system. Tasks can include a description and optionally tags. Tags can be added directly using the '+' prefix. ```shell tl add Improve the TaskLite manual tl add Improve the TaskLite manual +tasklite +pc ``` -------------------------------- ### Complete and Modify Tasks with TaskLite CLI Source: https://context7.com/ad-si/tasklite/llms.txt Commands for marking tasks as done, obsolete, or deletable. Also shows how to add/remove tags, set due dates, priorities, add notes, and view task details using task IDs. ```bash # Complete a task tl do pb # Output: ✅ Finished task "Buy milk" with id "01dd62xryn5fnzjgynkcy06spb" # Mark as obsolete tl obsolete 01dd62xryn5fnzjgynkcy06spb # Mark as deletable tl deletable 01dd62xryn5fnzjgynkcy06spb # Add a tag to existing task tl tag urgent 01dd62xryn5fnzjgynkcy06spb # Remove a tag tl deletetag groceries 01dd62xryn5fnzjgynkcy06spb # Set due date tl due 2024-12-25 01dd62xryn5fnzjgynkcy06spb # Set priority tl prioritize 01dd62xryn5fnzjgynkcy06spb # Add a note tl note "Remember to check the expiration date" 01dd62xryn5fnzjgynkcy06spb # View task details tl info 01dd62xryn5fnzjgynkcy06spb ``` -------------------------------- ### TaskLite Hook Input for 'pre-add' Stage (JSON5) Source: https://github.com/ad-si/tasklite/blob/main/docs-source/cli/hooks/main.md This JSON structure details the input provided to the `pre-add` hook. It includes command-line arguments and the task object that is about to be added. This allows for validation or modification before the task is actually added. ```json { arguments: […], taskToAdd: {} } ```