sfctl 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.buildkite/hooks/pre-command +5 -0
- data/.buildkite/pipeline.yml +9 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.rubocop.yml +76 -0
- data/.tool-versions +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +40 -0
- data/Gemfile.lock +186 -0
- data/README.md +276 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/sfctl +18 -0
- data/lib/sfctl.rb +5 -0
- data/lib/sfctl/cli.rb +44 -0
- data/lib/sfctl/command.rb +166 -0
- data/lib/sfctl/commands/account.rb +34 -0
- data/lib/sfctl/commands/account/assignments.rb +52 -0
- data/lib/sfctl/commands/account/info.rb +40 -0
- data/lib/sfctl/commands/auth.rb +35 -0
- data/lib/sfctl/commands/auth/bye.rb +26 -0
- data/lib/sfctl/commands/auth/init.rb +53 -0
- data/lib/sfctl/commands/time.rb +52 -0
- data/lib/sfctl/commands/time/connections.rb +33 -0
- data/lib/sfctl/commands/time/connections/add.rb +84 -0
- data/lib/sfctl/commands/time/connections/get.rb +53 -0
- data/lib/sfctl/commands/time/init.rb +23 -0
- data/lib/sfctl/commands/time/providers.rb +44 -0
- data/lib/sfctl/commands/time/providers/get.rb +41 -0
- data/lib/sfctl/commands/time/providers/set.rb +58 -0
- data/lib/sfctl/commands/time/providers/unset.rb +43 -0
- data/lib/sfctl/commands/time/sync.rb +215 -0
- data/lib/sfctl/starfish.rb +51 -0
- data/lib/sfctl/templates/.gitkeep +1 -0
- data/lib/sfctl/toggl.rb +27 -0
- data/lib/sfctl/version.rb +3 -0
- data/scripts/test.sh +8 -0
- data/sfctl.gemspec +28 -0
- metadata +84 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '01538701ef7e4ff9999297400cb4853751ad2b45485f18524e9545416e34e1a7'
|
4
|
+
data.tar.gz: 1ac3e8c834236ceb56556770057e99e5644c7e2b4a86e63daa8078239cca37de
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fccda9b85147a7373c83426de924435d56221fb350547b6957b8f760f3669ec529d21f04c10c9dbb566c35586be35c97788d2e0b28f236e7a00a50b2c7efeccb
|
7
|
+
data.tar.gz: 4567297fec6b1a36896c2322ffec80ead48b532d558b2804c4c7859dfe67fbc5ecb00eafc84854e3bec965fc1f6118bfdde08df35d8c0a637d3f2489d388f686
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
inherit_mode:
|
2
|
+
merge:
|
3
|
+
- Include
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
Include:
|
7
|
+
- "**/*.gemspec"
|
8
|
+
- "**/*.rake"
|
9
|
+
- "**/Gemfile"
|
10
|
+
- "**/Rakefile"
|
11
|
+
Exclude:
|
12
|
+
- "bin/**/*"
|
13
|
+
- "exe/**/*"
|
14
|
+
- "sfctl.gemspec"
|
15
|
+
CacheRootDirectory: tmp/cache/rubocop_cache/
|
16
|
+
TargetRubyVersion: 2.7.1
|
17
|
+
|
18
|
+
Style/Documentation:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Layout/MultilineMethodCallIndentation:
|
22
|
+
EnforcedStyle: indented
|
23
|
+
IndentationWidth: 2
|
24
|
+
|
25
|
+
Layout/LineLength:
|
26
|
+
Max: 120
|
27
|
+
|
28
|
+
Metrics/BlockLength:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Metrics/AbcSize:
|
32
|
+
Max: 20
|
33
|
+
|
34
|
+
Metrics/MethodLength:
|
35
|
+
Max: 20
|
36
|
+
|
37
|
+
Style/FrozenStringLiteralComment:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Layout/EndOfLine:
|
41
|
+
EnforcedStyle: lf
|
42
|
+
|
43
|
+
Naming/MemoizedInstanceVariableName:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
Lint/AmbiguousBlockAssociation:
|
47
|
+
Exclude:
|
48
|
+
- "spec/**/*"
|
49
|
+
|
50
|
+
Style/HashEachMethods:
|
51
|
+
Enabled: true
|
52
|
+
|
53
|
+
Style/HashTransformKeys:
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Style/HashTransformValues:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
Layout/HeredocIndentation:
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
Layout/TrailingWhitespace:
|
63
|
+
Exclude:
|
64
|
+
- "spec/sfctl_spec.rb"
|
65
|
+
- "spec/integration/**/*"
|
66
|
+
|
67
|
+
Layout/ClosingHeredocIndentation:
|
68
|
+
Exclude:
|
69
|
+
- "spec/sfctl_spec.rb"
|
70
|
+
- "spec/integration/**/*"
|
71
|
+
|
72
|
+
Lint/RaiseException:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
Lint/StructNewOverride:
|
76
|
+
Enabled: true
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.7.1
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at vilatti@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in sfctl.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem 'faraday'
|
7
|
+
gem 'pastel'
|
8
|
+
gem 'rake', '~> 12.0'
|
9
|
+
gem 'thor'
|
10
|
+
gem 'tty-box'
|
11
|
+
gem 'tty-color'
|
12
|
+
gem 'tty-command'
|
13
|
+
gem 'tty-config'
|
14
|
+
gem 'tty-cursor'
|
15
|
+
gem 'tty-editor'
|
16
|
+
gem 'tty-file'
|
17
|
+
gem 'tty-font'
|
18
|
+
gem 'tty-link'
|
19
|
+
gem 'tty-logger'
|
20
|
+
gem 'tty-markdown'
|
21
|
+
gem 'tty-pager'
|
22
|
+
gem 'tty-pie'
|
23
|
+
gem 'tty-platform'
|
24
|
+
gem 'tty-progressbar'
|
25
|
+
gem 'tty-prompt'
|
26
|
+
gem 'tty-reader'
|
27
|
+
gem 'tty-screen'
|
28
|
+
gem 'tty-spinner'
|
29
|
+
gem 'tty-table'
|
30
|
+
gem 'tty-tree'
|
31
|
+
gem 'tty-which'
|
32
|
+
|
33
|
+
group :development, :test do
|
34
|
+
gem 'fuubar'
|
35
|
+
gem 'pry-byebug'
|
36
|
+
gem 'rspec'
|
37
|
+
gem 'rubocop'
|
38
|
+
gem 'simplecov'
|
39
|
+
gem 'webmock'
|
40
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,186 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sfctl (0.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
addressable (2.7.0)
|
10
|
+
public_suffix (>= 2.0.2, < 5.0)
|
11
|
+
ast (2.4.0)
|
12
|
+
byebug (11.1.1)
|
13
|
+
coderay (1.1.2)
|
14
|
+
crack (0.4.3)
|
15
|
+
safe_yaml (~> 1.0.0)
|
16
|
+
diff-lcs (1.3)
|
17
|
+
docile (1.3.2)
|
18
|
+
equatable (0.6.1)
|
19
|
+
faraday (1.0.1)
|
20
|
+
multipart-post (>= 1.2, < 3)
|
21
|
+
fuubar (2.5.0)
|
22
|
+
rspec-core (~> 3.0)
|
23
|
+
ruby-progressbar (~> 1.4)
|
24
|
+
hashdiff (1.0.1)
|
25
|
+
jaro_winkler (1.5.4)
|
26
|
+
kramdown (1.16.2)
|
27
|
+
method_source (1.0.0)
|
28
|
+
multipart-post (2.1.1)
|
29
|
+
necromancer (0.5.1)
|
30
|
+
parallel (1.19.1)
|
31
|
+
parser (2.7.0.5)
|
32
|
+
ast (~> 2.4.0)
|
33
|
+
pastel (0.7.3)
|
34
|
+
equatable (~> 0.6)
|
35
|
+
tty-color (~> 0.5)
|
36
|
+
pry (0.13.0)
|
37
|
+
coderay (~> 1.1)
|
38
|
+
method_source (~> 1.0)
|
39
|
+
pry-byebug (3.9.0)
|
40
|
+
byebug (~> 11.0)
|
41
|
+
pry (~> 0.13.0)
|
42
|
+
public_suffix (4.0.3)
|
43
|
+
rainbow (3.0.0)
|
44
|
+
rake (12.3.3)
|
45
|
+
rexml (3.2.4)
|
46
|
+
rouge (3.17.0)
|
47
|
+
rspec (3.9.0)
|
48
|
+
rspec-core (~> 3.9.0)
|
49
|
+
rspec-expectations (~> 3.9.0)
|
50
|
+
rspec-mocks (~> 3.9.0)
|
51
|
+
rspec-core (3.9.1)
|
52
|
+
rspec-support (~> 3.9.1)
|
53
|
+
rspec-expectations (3.9.1)
|
54
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
+
rspec-support (~> 3.9.0)
|
56
|
+
rspec-mocks (3.9.1)
|
57
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
+
rspec-support (~> 3.9.0)
|
59
|
+
rspec-support (3.9.2)
|
60
|
+
rubocop (0.81.0)
|
61
|
+
jaro_winkler (~> 1.5.1)
|
62
|
+
parallel (~> 1.10)
|
63
|
+
parser (>= 2.7.0.1)
|
64
|
+
rainbow (>= 2.2.2, < 4.0)
|
65
|
+
rexml
|
66
|
+
ruby-progressbar (~> 1.7)
|
67
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
68
|
+
ruby-progressbar (1.10.1)
|
69
|
+
safe_yaml (1.0.5)
|
70
|
+
simplecov (0.18.5)
|
71
|
+
docile (~> 1.1)
|
72
|
+
simplecov-html (~> 0.11)
|
73
|
+
simplecov-html (0.12.2)
|
74
|
+
strings (0.1.8)
|
75
|
+
strings-ansi (~> 0.1)
|
76
|
+
unicode-display_width (~> 1.5)
|
77
|
+
unicode_utils (~> 1.4)
|
78
|
+
strings-ansi (0.1.0)
|
79
|
+
thor (1.0.1)
|
80
|
+
tty-box (0.5.0)
|
81
|
+
pastel (~> 0.7.2)
|
82
|
+
strings (~> 0.1.6)
|
83
|
+
tty-cursor (~> 0.7)
|
84
|
+
tty-color (0.5.1)
|
85
|
+
tty-command (0.9.0)
|
86
|
+
pastel (~> 0.7.0)
|
87
|
+
tty-config (0.4.0)
|
88
|
+
tty-cursor (0.7.1)
|
89
|
+
tty-editor (0.5.1)
|
90
|
+
tty-prompt (~> 0.19)
|
91
|
+
tty-which (~> 0.4)
|
92
|
+
tty-file (0.8.0)
|
93
|
+
diff-lcs (~> 1.3)
|
94
|
+
pastel (~> 0.7.2)
|
95
|
+
tty-prompt (~> 0.18)
|
96
|
+
tty-font (0.5.0)
|
97
|
+
tty-link (0.1.1)
|
98
|
+
tty-logger (0.3.0)
|
99
|
+
pastel (~> 0.7.0)
|
100
|
+
tty-markdown (0.6.0)
|
101
|
+
kramdown (~> 1.16.2)
|
102
|
+
pastel (~> 0.7.2)
|
103
|
+
rouge (~> 3.3)
|
104
|
+
strings (~> 0.1.4)
|
105
|
+
tty-color (~> 0.4)
|
106
|
+
tty-screen (~> 0.6)
|
107
|
+
tty-pager (0.12.1)
|
108
|
+
strings (~> 0.1.4)
|
109
|
+
tty-screen (~> 0.6)
|
110
|
+
tty-which (~> 0.4)
|
111
|
+
tty-pie (0.3.0)
|
112
|
+
pastel (~> 0.7.3)
|
113
|
+
tty-cursor (~> 0.7)
|
114
|
+
tty-platform (0.3.0)
|
115
|
+
tty-progressbar (0.17.0)
|
116
|
+
strings-ansi (~> 0.1.0)
|
117
|
+
tty-cursor (~> 0.7)
|
118
|
+
tty-screen (~> 0.7)
|
119
|
+
unicode-display_width (~> 1.6)
|
120
|
+
tty-prompt (0.21.0)
|
121
|
+
necromancer (~> 0.5.0)
|
122
|
+
pastel (~> 0.7.0)
|
123
|
+
tty-reader (~> 0.7.0)
|
124
|
+
tty-reader (0.7.0)
|
125
|
+
tty-cursor (~> 0.7)
|
126
|
+
tty-screen (~> 0.7)
|
127
|
+
wisper (~> 2.0.0)
|
128
|
+
tty-screen (0.7.1)
|
129
|
+
tty-spinner (0.9.3)
|
130
|
+
tty-cursor (~> 0.7)
|
131
|
+
tty-table (0.11.0)
|
132
|
+
equatable (~> 0.6)
|
133
|
+
necromancer (~> 0.5)
|
134
|
+
pastel (~> 0.7.2)
|
135
|
+
strings (~> 0.1.5)
|
136
|
+
tty-screen (~> 0.7)
|
137
|
+
tty-tree (0.4.0)
|
138
|
+
tty-which (0.4.2)
|
139
|
+
unicode-display_width (1.7.0)
|
140
|
+
unicode_utils (1.4.0)
|
141
|
+
webmock (3.8.3)
|
142
|
+
addressable (>= 2.3.6)
|
143
|
+
crack (>= 0.3.2)
|
144
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
145
|
+
wisper (2.0.1)
|
146
|
+
|
147
|
+
PLATFORMS
|
148
|
+
ruby
|
149
|
+
|
150
|
+
DEPENDENCIES
|
151
|
+
faraday
|
152
|
+
fuubar
|
153
|
+
pastel
|
154
|
+
pry-byebug
|
155
|
+
rake (~> 12.0)
|
156
|
+
rspec
|
157
|
+
rubocop
|
158
|
+
sfctl!
|
159
|
+
simplecov
|
160
|
+
thor
|
161
|
+
tty-box
|
162
|
+
tty-color
|
163
|
+
tty-command
|
164
|
+
tty-config
|
165
|
+
tty-cursor
|
166
|
+
tty-editor
|
167
|
+
tty-file
|
168
|
+
tty-font
|
169
|
+
tty-link
|
170
|
+
tty-logger
|
171
|
+
tty-markdown
|
172
|
+
tty-pager
|
173
|
+
tty-pie
|
174
|
+
tty-platform
|
175
|
+
tty-progressbar
|
176
|
+
tty-prompt
|
177
|
+
tty-reader
|
178
|
+
tty-screen
|
179
|
+
tty-spinner
|
180
|
+
tty-table
|
181
|
+
tty-tree
|
182
|
+
tty-which
|
183
|
+
webmock
|
184
|
+
|
185
|
+
BUNDLED WITH
|
186
|
+
2.1.4
|
data/README.md
ADDED
@@ -0,0 +1,276 @@
|
|
1
|
+
# sfctl [![Build status](https://badge.buildkite.com/22ecc67f358163f4714383ff0fde8e847d1e3ae488fc10312f.svg)](https://buildkite.com/starfish/sf-control)
|
2
|
+
|
3
|
+
```
|
4
|
+
sfctl is a command line interface for the Starfish API.
|
5
|
+
|
6
|
+
Usage:
|
7
|
+
sfctl [command]
|
8
|
+
|
9
|
+
Available Commands:
|
10
|
+
account account commands
|
11
|
+
auth auth commands
|
12
|
+
time time reporting commands
|
13
|
+
version show the current version
|
14
|
+
|
15
|
+
Flags:
|
16
|
+
-a, --all don't filter data
|
17
|
+
-d, --dry-run just execute the command - no writes to starfish.team
|
18
|
+
-h, --help help for fsctl
|
19
|
+
-t, --touchy no data will be overwritten in starfish.team
|
20
|
+
```
|
21
|
+
|
22
|
+
## Installing `sfctl`
|
23
|
+
|
24
|
+
### Using a Package Manager (Preferred)
|
25
|
+
|
26
|
+
More to come.
|
27
|
+
|
28
|
+
### Git
|
29
|
+
|
30
|
+
More to come.
|
31
|
+
|
32
|
+
## Authentication
|
33
|
+
|
34
|
+
Before you can use `sfctl`, you need to authenticate with Starfish.team by providing an access token, which can be created on the profile page of your account.
|
35
|
+
|
36
|
+
```
|
37
|
+
sfctl auth init
|
38
|
+
```
|
39
|
+
|
40
|
+
You wil be promted to enter your access token that you've generated on the profile page.
|
41
|
+
|
42
|
+
```
|
43
|
+
Starfish.team access token: YOUR_TOKEN
|
44
|
+
```
|
45
|
+
|
46
|
+
After entering your token, you will receive confirmation that the credentials were accepted. In case your token is not accepted, please make sure you copy and paste it correctly.
|
47
|
+
|
48
|
+
```
|
49
|
+
Your token is valid 👍
|
50
|
+
```
|
51
|
+
|
52
|
+
As a consequece a `.sfctl` directory will be created in your `$HOME` and all data is stored for further use. You can safely copy this folder to other machines to replicate the access. Just be aware this is giving the user controlling the directory access to your starfish account.
|
53
|
+
|
54
|
+
You can log out by either removing the config directory or by executing the following command:
|
55
|
+
|
56
|
+
```
|
57
|
+
sfctl auth bye
|
58
|
+
```
|
59
|
+
|
60
|
+
## Account Details
|
61
|
+
|
62
|
+
You can access your account details directly from the command line.
|
63
|
+
|
64
|
+
### Account Info
|
65
|
+
|
66
|
+
```
|
67
|
+
sfctl account info
|
68
|
+
```
|
69
|
+
|
70
|
+
This will read your profile data and give you an overview of your account.
|
71
|
+
|
72
|
+
```
|
73
|
+
Hi [FULL NAME]
|
74
|
+
|
75
|
+
we have stored this information for you.
|
76
|
+
|
77
|
+
Username Email
|
78
|
+
---------------------------
|
79
|
+
[USERNAME] [EMAIL]
|
80
|
+
```
|
81
|
+
|
82
|
+
### Assignments
|
83
|
+
|
84
|
+
```
|
85
|
+
sfctl account assignments
|
86
|
+
```
|
87
|
+
|
88
|
+
This command will list all of your assignments that are currently active. If you want to read all assignments you have to provide the flag `-a`.
|
89
|
+
|
90
|
+
```
|
91
|
+
Assignment [NAME]
|
92
|
+
-------------------------
|
93
|
+
Service: [SERVICE NAME]
|
94
|
+
Start: [START DATE]
|
95
|
+
End: [END DATE]
|
96
|
+
Budget: [AMOUNT] [UNIT]
|
97
|
+
|
98
|
+
[MORE ASSIGNMENTS]
|
99
|
+
```
|
100
|
+
|
101
|
+
## Time Reports
|
102
|
+
|
103
|
+
Time reports and consolidation are an essential part of Starfish.team. You are able to configure on a project level which assignments you want to charge with time report data you have. The time report data will come from standard time tracking tools and will be loaded to starfish using commands in this section.
|
104
|
+
|
105
|
+
The key consideration for the approach to support this with a command line interface is to prevent you from storing your personal secrets (like the accesstoken to your lovely time-reporting tool) on our system.
|
106
|
+
|
107
|
+
We will provide a couple of integrations but also open up for plugins later on to extend to what's out there.
|
108
|
+
|
109
|
+
As of today we support:
|
110
|
+
|
111
|
+
- Toggl
|
112
|
+
- Harvest
|
113
|
+
- Clockify
|
114
|
+
|
115
|
+
Another advantage of this approach is, that you think of any automation ⚒ you like to support your processes.
|
116
|
+
|
117
|
+
### Initialize a Project
|
118
|
+
|
119
|
+
In your project's root directory you can use the following command to create a `.sflink` file that will store your project configuration. Although sensitive data is stored in the main `.sfctl` directory we'd like to recommend to not add the `.sflink` file to your version control system.
|
120
|
+
|
121
|
+
```
|
122
|
+
sfctl time init
|
123
|
+
```
|
124
|
+
|
125
|
+
### Get Current Providers
|
126
|
+
|
127
|
+
```
|
128
|
+
sfctl time providers get
|
129
|
+
```
|
130
|
+
|
131
|
+
This command will read which providers are configured on your system. These configurations include sensitve information (e.g. access-tokens etc.) and will be read from the `.sfct` main directory.
|
132
|
+
|
133
|
+
```
|
134
|
+
Provider: [harvest|toggl|clockify]
|
135
|
+
ACCESS_TOKEN: [TOKEN]
|
136
|
+
ACCOUNT_ID: [ACCOUNT_ID]
|
137
|
+
...
|
138
|
+
|
139
|
+
[More Providers]
|
140
|
+
```
|
141
|
+
|
142
|
+
The information stored is specific for each provider and contains the basic data that is required to authenticate on the API level.
|
143
|
+
|
144
|
+
### Set A Provider
|
145
|
+
|
146
|
+
```
|
147
|
+
sfctl time providers set [harvest|toggl|clockify]
|
148
|
+
```
|
149
|
+
|
150
|
+
With this command you set the configuration required for the provider to authenticate a call to their API.
|
151
|
+
As stated already, the required information depends on the API of the provider.
|
152
|
+
|
153
|
+
The system will prompt you for the data.
|
154
|
+
|
155
|
+
```
|
156
|
+
Setting up [harvest|toggl|clockify]
|
157
|
+
Your access token at [harvest|toggl|clockify]: ACCESS_TOKEN
|
158
|
+
...
|
159
|
+
Is that information correct? (Y/n)
|
160
|
+
```
|
161
|
+
|
162
|
+
In case there is already a configuration for the provider, you will if you want to overwrite that information.
|
163
|
+
|
164
|
+
```
|
165
|
+
Setting up [harvest|toggl|clockify]
|
166
|
+
You already have a configuration for this provider.
|
167
|
+
|
168
|
+
Do you want to replace it? (Y/n)
|
169
|
+
...
|
170
|
+
```
|
171
|
+
|
172
|
+
### Unset A Provider
|
173
|
+
|
174
|
+
```
|
175
|
+
sfctl time providers unset [harvest|toggl|clockify]
|
176
|
+
```
|
177
|
+
|
178
|
+
With this command you can unset the configuration of a provider.
|
179
|
+
|
180
|
+
```
|
181
|
+
Unsetting [harvest|toggl|clockify]
|
182
|
+
|
183
|
+
Do you want to remove the delete the configuration? (Y/n)
|
184
|
+
...
|
185
|
+
```
|
186
|
+
|
187
|
+
### Get Current Connections
|
188
|
+
|
189
|
+
Connections are the project specific link of a time-reporting tool and respective reporting setup there with an assignment at Starfish.team.
|
190
|
+
|
191
|
+
```
|
192
|
+
sfctl time connections get
|
193
|
+
```
|
194
|
+
|
195
|
+
This will list all known connections in that project. The data is read from the `.sflink` file.
|
196
|
+
|
197
|
+
```
|
198
|
+
Connection: [ASSIGNMENT NAME]
|
199
|
+
provider: toggl
|
200
|
+
workspace_id: 54321
|
201
|
+
project_ids: 123, 324,23, 333
|
202
|
+
task_ids:
|
203
|
+
billable: both
|
204
|
+
rounding: off
|
205
|
+
|
206
|
+
[MORE CONNECTIONS]
|
207
|
+
```
|
208
|
+
|
209
|
+
### Add a Connection
|
210
|
+
|
211
|
+
```
|
212
|
+
sfctl time connections add [harvest|toggl|clockify]
|
213
|
+
```
|
214
|
+
|
215
|
+
This command will add a connection between a provider and an assignment. In each project configuration you can have only one connection per assignment.
|
216
|
+
|
217
|
+
The system will therefore prompt you to select one of the not yet connected assignments.
|
218
|
+
|
219
|
+
```
|
220
|
+
Select on assignment first:
|
221
|
+
|
222
|
+
1. [ASSIGNMENT NAME] / [SERVICE]
|
223
|
+
2. [ASSIGNMENT NAME] / [SERVICE]
|
224
|
+
...
|
225
|
+
```
|
226
|
+
|
227
|
+
After selecting the assignment the command will prompt you to enter the provider specific data.
|
228
|
+
See an example for toggl below:
|
229
|
+
|
230
|
+
```
|
231
|
+
Workspace ID (required): [WORKSPACE_ID]
|
232
|
+
Project IDs (required / comma separated): [LIST OF PROJECT IDS]
|
233
|
+
Task IDs (optional / comma separated): [LIST OF TASK IDS]
|
234
|
+
Billable? (required): [BILLED|UNBILLED|BOTH]
|
235
|
+
Rounding? (required): [ON|OFF]
|
236
|
+
```
|
237
|
+
|
238
|
+
### Synchronize Data
|
239
|
+
|
240
|
+
This command is the essential part of the whole CLI. It will gets for each assignment the next reporting segment from starfish.team and loads the corresponding time reports from the provider.
|
241
|
+
|
242
|
+
This command supports the `--dry-run` and the `--touchy` flag, such that you could check the data first respectively prevent data from being overwritten.
|
243
|
+
|
244
|
+
```
|
245
|
+
sfctl time sync
|
246
|
+
```
|
247
|
+
|
248
|
+
It will ask you if you want to sync all assignments or only a single one.
|
249
|
+
|
250
|
+
```
|
251
|
+
Which assignment do you want to sync?
|
252
|
+
1. [ASSIGNMENT NAME] / [SERVICE]
|
253
|
+
2. [ASSIGNMENT NAME] / [SERVICE]
|
254
|
+
N. [ALL]
|
255
|
+
```
|
256
|
+
|
257
|
+
In case there is no next reporting segment on starfish that accepts time report data, the synchronization will be skipped. All others are synchronized in sequence.
|
258
|
+
|
259
|
+
If the `--touchy` flag was used, the synchronizsation will be skipped if there is preexisting data.
|
260
|
+
|
261
|
+
```
|
262
|
+
Synchronizing: [ASSIGNMENT NAME] / [SERVICE]
|
263
|
+
Next Report: [2020-03]
|
264
|
+
Loaded data from [harvest|toggl|clockify]: [IN PROGRESS|DONE]
|
265
|
+
|
266
|
+
Date Comment Time
|
267
|
+
-------------------------------------------
|
268
|
+
2020.03.01 Work Work 7.75h
|
269
|
+
...
|
270
|
+
|
271
|
+
Total: 150.00h
|
272
|
+
|
273
|
+
Uploading to starfish.team: [IN PROGRESS|DONE]
|
274
|
+
|
275
|
+
[NEXT CONNECTION]
|
276
|
+
```
|