Skip to content

Comments

Initial CLI interface#2241

Open
PhilipWhiteside wants to merge 21 commits intoalainm23:mainfrom
PhilipWhiteside:cli-interface
Open

Initial CLI interface#2241
PhilipWhiteside wants to merge 21 commits intoalainm23:mainfrom
PhilipWhiteside:cli-interface

Conversation

@PhilipWhiteside
Copy link

This PR adds a CLI interface with an "add" capability, similar to the quick_add CLI command which shows a modal. The CLI interface has no UI modal, taking values as arguments, and inserting them. This could be fairly easy to expand for a "get", "list", "list-projects", "dump", etc but I currently don't have need for that capability.

My initial intention for this was to import tasks from other sources. I.e. I use Obsidian for my notes and make inline tasks, I can easily export all checkbox tasks from the markdown files, and then needed an interface to insert them.

I have copied the copyright statement from other files, assigning copyright to Alain M, but removed the authored by line as I didn't want to force something you didn't do onto you. I did not see any other PRs add themselves as authored by, so left myself out too, happy to change if you'd prefer.

Examples

# Basic
[philip@philip-laptop:~/src/planify]$ ./result/bin/io.github.alainm23.planify.cli \
  add \
  --content "Task created in Inbox" 
{
  "taskId": "381b23fc-018c-4cc5-ad87-3fe41ac1bcc4",
  "projectId": "d65ae27f-b60c-41b2-9d70-0658f14e11f2",
  "projectName": "Inbox"
}

# With metadata
[philip@philip-laptop:~/src/planify]$ ./result/bin/io.github.alainm23.planify.cli \
  add \
  --content "Task created in Inbox with metadata" \
  --due 2026-02-10\
  --priority 1\
  --description "Foobar info"
{
  "taskId": "a181622a-480d-4c81-99d8-34a130c43f38",
  "projectId": "d65ae27f-b60c-41b2-9d70-0658f14e11f2",
  "projectName": "Inbox"
}

# With project (by name)
[philip@philip-laptop:~/src/planify]$ ./result/bin/io.github.alainm23.planify.cli \
  add \
  --content "Task created in project" \
  --project "Test Project" 
{
  "taskId": "d7fa6728-e64c-4a1f-843c-ab206d7591a0",
  "projectId": "641c542a-c156-4415-a34b-9b9243157227",
  "projectName": "Test Project"
}

# With project (by ID) - Useful if a duplicae name exists
[philip@philip-laptop:~/src/planify]$ ./result/bin/io.github.alainm23.planify.cli \
  add \
  --content "Task created in project by ID" \
  --project-id "641c542a-c156-4415-a34b-9b9243157227" 
{
  "taskId": "df251218-ab3f-4d9d-bd54-3fa1960b5406",
  "projectId": "641c542a-c156-4415-a34b-9b9243157227",
  "projectName": "Test Project"
}

# With nested project (by name)
[philip@philip-laptop:~/src/planify]$ ./result/bin/io.github.alainm23.planify.cli \
  add \
  --content "Task created in nested project" \
  --project "Child" 
{
  "taskId": "c58afebb-dd63-42c4-98eb-da24759f2d98",
  "projectId": "2d83f551-a2ab-400a-a866-2ee0a4bc6dfa",
  "projectName": "Child"
}

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

Translation files need updating

  • Apply translation updates

@alainm23
Copy link
Owner

alainm23 commented Feb 8, 2026

Oh, this looks quite interesting. I’d like to see whether it can also be used in a Flatpak environment. I’ll take a closer look later — thanks.

@PhilipWhiteside
Copy link
Author

Thanks, I hope it can be, as that's how I consume Planify. In my view it would be the same as the current quick-add which is what inspired me to do this. E.g.

flatpak run --command=io.github.alainm23.planify.cli io.github.alainm23.planify add --content "Foo"

I'll try get the flapak running to show this.

@PhilipWhiteside
Copy link
Author

Here's a small demo video of it working with the flatpak version.

2026-02-08.17-17-47.mp4

@alainm23 alainm23 changed the base branch from master to main February 13, 2026 11:42
@PhilipWhiteside PhilipWhiteside force-pushed the cli-interface branch 2 times, most recently from ea52a61 to 8f98bf6 Compare February 18, 2026 23:44
@PhilipWhiteside
Copy link
Author

Some more things added:

  • Bunch more commands
    • list (tasks)
    • list-projects
    • update (task)
  • A parent-id option to the add command to nest.
  • Made the JSON output a proper object instead of string formatting.
  • Rebased on the latest main since a release came out. Reverted my duplicate fix that was fixed in main.

The CLI is still represented in the video shared above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants