Add first version for usage as CLI Tool

NOT FINISHED!
This commit is contained in:
2024-02-25 12:37:47 +00:00
parent bec839e98e
commit 17f3f29c76
7 changed files with 125 additions and 127 deletions
+18 -28
View File
@@ -14,39 +14,29 @@
2. Request a token for some Account (user could have multiple accounts) using the Account `url` and the users `intent`
3. Use the token to authenticate for every other API-Call
Example login:
## CLI (Work in progress)
```python
auth = ACAuthenticator()
session = auth.login(username, password)
pprint(session)
user = session['user']
# use first account
account = auth.find_account(account_name)
```
> activecollab [options] [command] [object] [arguments]
Example request token
### Options
```python
token = ACTokenAuthenticator(account, user).issue_token_intent()
pprint(token)
```
- config=<file> - read config from file (json)
Example client request
### Command
```python
ac = ACClient(account, token)
res = ac.get_projects()
pprint(res.json())
```
- list
- get
- create
- update
- delete
-
### Object
## Configuration
- info - get Info like version nummer from server
- project
- task
- subtask
- people
- invoice
config.ini:
```ini
[LOGIN]
username = you@example.com
password = very-secret
account_name = "#123456"
```