A CLI task management tool with remote access capabilities.
This project is a CLI task manager/todo application, with a web server built using Echo, and an SQLite database to hold the task data.
It is built as a reimplementaion and continuation of TaskCLI which itself is inspired by Task Warrior. It is not a fork, but rather a reimagination from scratch. Some components have been copied (e.g. the CLI Kanban command and helper functions). After the initial implementation, some conventions from the TaskCLI were used (e.g. using a status
enum, instead of a bool (todo/done) used originally) when they were more convenient than the original implementation.
The differences with TaskCLI, at a glance:
- implemented an Echo server for remotely accessing the tasks (multiple clients)
- implemented updating all clients through Gorilla WebSocket
- added Docker containers with build and run scripts for the app
- added optional extra functionality such as a
task_type
enum anddescription
fields to the tasks - implemented an extra CLI command,
deldb
, to clear the database of tasks
- Go: the Go language, use
go version
command to check if it is installed. This has been tested ongo1.21.4
. If you use Docker, you don't need to install it. - (optional) Docker: if you prefer to run the app in a container, scripts are included for building and running the app in a Docker container
- (optional) Server node: If you want to have a task-gopher server that you can access from other devices, then I suggest using ZeroTier, which allows you to add devices to a virtual network so you can view them as if they are on your local network, with static IP addresses, as long as they are connected to the internet. I prefer it because it is simple, open source, and free for personal use.
Clone this repo - we use the Go convention of holding packages from GitHub in $HOME/go/src/github.com/<username>/<package>
:
git clone https://github.com/czonios/task-gopher.git $HOME/go/src/github.com/czonios/task-gopher
The application tries to read a .env
file in the root directory of the project and load the environment variables it contains. The .env
file is optional, but the following environment variables must be set:
ADDRESS
the address of the serverPORT
the port the server runs on
The following commands start the task-gopher server (on the device that will hold the database). Don't forget to set the ADDRESS
and PORT
of the server as environment variables in .env
for this to work! Since this is the server instance, you can use http://localhost
for the ADDRESS
.
# cd to root directory of project
cd $HOME/go/src/github.com/czonios/task-gopher
go install ./...
task-gopher serve
# NOTE: $HOME/go/bin should be in your PATH
# otherwise you can run go run ./... serve
# cd to root directory of project
cd $HOME/go/src/github.com/czonios/task-gopher
cd build
docker compose up
The client can be either in the same machine as the server, or in any other machine that can ping the server.
Don't forget to set the ADDRESS
and PORT
of the server as environment variables in $HOME/go/src/github.com/czonios/task-gopher/.env
for this to work!
# cd to root directory of project
cd $HOME/go/src/github.com/czonios/task-gopher
go install ./...
task-gopher --help # will list available commands
# NOTE: $HOME/go/bin should be in your PATH
# otherwise you can run go run ./... --help
# coming soon!
Christos A. Zonios – czonios.github.io – c.zonios (at) uoi (dot) gr
Distributed under the MIT license. See LICENSE
for more information.
https://github.com/czonios/task-gopher
- Fork it (https://github.com/czonios/task-gopher/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Run the tests
- Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
task-gopher
├── LICENSE
├── README.md
├── assets
│ └── logo.png
├── build
│ ├── build_docker_img.sh # script for building the docker image
│ └── dockerfile
├├── cmd
│ └── task-gopher
│ ├── cli.go # Cobra commands and setup for CLI
│ ├── server.go # server and routes to interract with the task manager
│ └── task-gopher.go # main function, Task struct, handles initial setup
├── data
│ └── tasks.db # created by the server
├── go.mod
└── scripts
├── run_docker_daemon.sh # script for running the docker container as a daemon on startup
└── run_docker_img.sh # script for normal docker run
go test ./...
- server container
- app container
- documentation for containers
-
task-gopher.go
-
server.go