<commit_before># td [![Build Status](https://travis-ci.org/mssola/td.svg?branch=master)](https://travis-ci.org/mssola/td)

This is a CLI application for my [To Do](https://github.com/mssola/todo) service.

## Usage

### Login & logout

First of all, we have to login.

    $ td login

It will ask for the full URL of the server that is running our [To
Do](https://github.com/mssola/todo) instance, the user name and its password.
If we're successful, the user will get authenticated and its topics will be
fetched automatically.

We don't have to do this again, this user will be logged in from now on.
However, you might want to delete the current session. For this you can
just use the `logout` command.

### Commands

In this section I'm assuming that you've already logged in. At this point there
are a lot of things that can be done. You can see the full list of commands by
executing the following command:

    $ td --help

The workflow for this application is as follows:

1. Work locally. Edit the "To do" list, etc.
2. Then push your changes to the server.

First of all, let's see how we can interact with the server. There are
basically two commands for this: `fetch` and `push`. The `fetch` command pulls
everything from the server and saves it to our local setup. Note that currently
this command will effectively wipe out the contents of our local setup. This is
not a good thing, so I'll fix it as soon as possible. The `push` command will
grab all our local editions and push it to the server.

One can create and delete topics with the `create` and `delete` commands,
respectively. Note that both commands expect the name of the topic to be
created/deleted. Moreover, a topic can be renamed with the `rename` command.
This command expects two parameters: the old and the new name, in this order.
As an example:

    $ td create test
    $ td rename test another
    $ td delete another

The most important thing is to view the "To do" list and edit it. For this you
don't have to pass any parameter to the `td` executable. If you do that, then
your preferred editor will be openned in the directory where all the topics are
being stored. Your preferred editor is the one set in the `EDITOR` environment
variable. If this environment variable is not set, then `vi` gets picked. Each
topic is represented as a file, and the name of the topic is the name of its
file.

Note that you don't have to open the editor to know the topics that you have.
You can just perform the `list` command for that.

## TODO

- Treat errors on create, update, delete...
- Commands such as: status, diff.
- timeouts

## License

Copyright &copy; 2014 <NAME>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including<commit_msg>Added the bash completion into the README file.<commit_after># td [![Build Status](https://travis-ci.org/mssola/td.svg?branch=master)](https://travis-ci.org/mssola/td)

This is a CLI application for my [To Do](https://github.com/mssola/todo) service.

## Usage

### Login & logout

First of all, we have to login.

    $ td login

It will ask for the full URL of the server that is running our [To
Do](https://github.com/mssola/todo) instance, the user name and its password.
If we're successful, the user will get authenticated and its topics will be
fetched automatically.

We don't have to do this again, this user will be logged in from now on.
However, you might want to delete the current session. For this you can
just use the `logout` command.

### Commands

In this section I'm assuming that you've already logged in. At this point there
are a lot of things that can be done. You can see the full list of commands by
executing the following command:

    $ td --help

The workflow for this application is as follows:

1. Work locally. Edit the "To do" list, etc.
2. Then push your changes to the server.

First of all, let's see how we can interact with the server. There are
basically two commands for this: `fetch` and `push`. The `fetch` command pulls
everything from the server and saves it to our local setup. Note that currently
this command will effectively wipe out the contents of our local setup. This is
not a good thing, so I'll fix it as soon as possible. The `push` command will
grab all our local editions and push it to the server.

One can create and delete topics with the `create` and `delete` commands,
respectively. Note that both commands expect the name of the topic to be
created/deleted. Moreover, a topic can be renamed with the `rename` command.
This command expects two parameters: the old and the new name, in this order.
As an example:

    $ td create test
    $ td rename test another
    $ td delete another

The most important thing is to view the "To do" list and edit it. For this you
don't have to pass any parameter to the `td` executable. If you do that, then
your preferred editor will be openned in the directory where all the topics are
being stored. Your preferred editor is the one set in the `EDITOR` environment
variable. If this environment variable is not set, then `vi` gets picked. Each
topic is represented as a file, and the name of the topic is the name of its
file.

Note that you don't have to open the editor to know the topics that you have.
You can just perform the `list` command for that.

### Bash completion

This package includes a shell script that offers bash completion for this
application. The completion file is `config/tdcompletion.sh`. Install it
wherever you want and source it in your `.bashrc` file.

## TODO

- Treat errors on create, update, delete...
- Commands such as: status, diff.
- timeouts

## License

Copyright &copy; 2014 <NAME>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
{'fraction_non_alphanumeric': 0.06273986317370266, 'fraction_numerical': 0.002002336058735191, 'mean_word_length': 3.8811074918566777, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3558004', 'n_tokens_mistral': 1631, 'n_tokens_neox': 1575, 'n_words': 976}