flycal-cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +85 -68
- data/lib/flycal_cli/cli.rb +2 -2
- data/lib/flycal_cli/version.rb +1 -1
- metadata +3 -3
- /data/{exe → bin}/flycal +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c7e777c9b4698b273770ea0d9a70edf232ffe70f2e6bd9d32ab65818ca0f5cb5
|
|
4
|
+
data.tar.gz: 5d62d5fede48b31930a6a652c8b4f165a0f82315eb85e3fb5be885e56ffc2ae7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1d95fcb97e10fa0c1144e15c7e205cb693d2c48847dc96569cb718c8899c5ecb3479504b4c19b3315dd8c74ecbcbc9510e99f2070a4c392ae206c51dba395dd
|
|
7
|
+
data.tar.gz: 6d9d08601b3d78d1aa8d3520b2f0102517b80be6ac708d0d036e3e5558d2548c1a57613f9b3121ebb12329f564a682b71843ac96b5c56a07cdf578f4dcab8f71
|
data/README.md
CHANGED
|
@@ -1,139 +1,156 @@
|
|
|
1
1
|
# flycal-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A command-line tool to access and search Google Calendar events. Connect your Google account, choose a default calendar, and search events with flexible date ranges and text filters.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Ruby 3.1 or later
|
|
8
|
+
- A Google Cloud project with Calendar API enabled
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
6
11
|
|
|
7
12
|
```bash
|
|
8
13
|
gem install flycal-cli
|
|
9
14
|
```
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
Or add to your Gemfile:
|
|
12
17
|
|
|
13
18
|
```ruby
|
|
14
19
|
gem "flycal-cli"
|
|
15
20
|
```
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
Then run `bundle install`.
|
|
23
|
+
|
|
24
|
+
## Setup
|
|
18
25
|
|
|
19
|
-
|
|
26
|
+
Before using flycal, you need OAuth credentials from Google Cloud Console:
|
|
20
27
|
|
|
21
|
-
1.
|
|
22
|
-
2.
|
|
23
|
-
3.
|
|
24
|
-
4.
|
|
25
|
-
5.
|
|
28
|
+
1. Go to [Google Cloud Console - Credentials](https://console.cloud.google.com/apis/credentials)
|
|
29
|
+
2. Create a project or select an existing one
|
|
30
|
+
3. Enable the **Google Calendar API** (APIs & Services → Library → search for "Google Calendar API")
|
|
31
|
+
4. Create **Desktop app** credentials (OAuth 2.0 Client IDs)
|
|
32
|
+
5. Add this URI as an authorized redirect:
|
|
26
33
|
```
|
|
27
34
|
http://127.0.0.1:9292/oauth2callback
|
|
28
35
|
```
|
|
29
|
-
6.
|
|
36
|
+
6. Download the JSON file and save it as `~/.flycal/credentials.json`
|
|
30
37
|
|
|
31
|
-
##
|
|
38
|
+
## Commands
|
|
32
39
|
|
|
33
|
-
###
|
|
40
|
+
### login
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
Connect to your Google account. Opens a browser for OAuth authentication when not yet connected.
|
|
36
43
|
|
|
37
44
|
```bash
|
|
38
45
|
flycal login
|
|
39
46
|
```
|
|
40
47
|
|
|
41
|
-
|
|
48
|
+
If already connected, the command reports the current status and suggests running `flycal calendars` to set the default calendar.
|
|
42
49
|
|
|
43
|
-
|
|
50
|
+
### logout
|
|
51
|
+
|
|
52
|
+
Disconnect from your Google account and remove stored tokens.
|
|
44
53
|
|
|
45
54
|
```bash
|
|
46
|
-
flycal
|
|
55
|
+
flycal logout
|
|
47
56
|
```
|
|
48
57
|
|
|
49
|
-
###
|
|
58
|
+
### calendars
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
List available calendars and set the default one. Uses an interactive scrollable menu (arrow keys to navigate, type to filter).
|
|
52
61
|
|
|
53
62
|
```bash
|
|
54
|
-
flycal
|
|
63
|
+
flycal calendars
|
|
55
64
|
```
|
|
56
65
|
|
|
57
|
-
|
|
66
|
+
The default calendar is used by the search command when no calendar is specified.
|
|
67
|
+
|
|
68
|
+
### search
|
|
58
69
|
|
|
59
|
-
|
|
70
|
+
Search for events in your calendar(s). Supports flexible date ranges and text filtering.
|
|
60
71
|
|
|
61
72
|
```bash
|
|
62
|
-
flycal search
|
|
63
|
-
flycal search
|
|
64
|
-
flycal search -f 2025-
|
|
73
|
+
flycal search
|
|
74
|
+
flycal search --in 30days --description placeholder
|
|
75
|
+
flycal search -f 2025-03-01 -t 2025-03-31 -c "Work"
|
|
76
|
+
flycal search -i 2months -d placeholder
|
|
65
77
|
```
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
- `-f, --from`: Data/ora inizio (es. `2025-01-01` o `2025-01-01T09:00`)
|
|
69
|
-
- `-t, --to`: Data/ora fine
|
|
70
|
-
- `-c, --calendar`: Nome o ID del calendario (default: calendario impostato con `flycal calendars`)
|
|
71
|
-
- `-d, --description`: Filtra eventi per testo nella descrizione
|
|
79
|
+
**Options:**
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
| Option | Short | Description |
|
|
82
|
+
|--------|-------|-------------|
|
|
83
|
+
| `--from` | `-f` | Start date/time. Default: midnight of current day. Format: `2025-01-01` or `2025-01-01T09:00` |
|
|
84
|
+
| `--to` | `-t` | End date/time. Default: 23:59 of the 30th day from today. Format: same as `--from` |
|
|
85
|
+
| `--in` | `-i` | Duration from `--from`, overrides `--to`. Format: `30days`, `48hours`, `2months`, `1year` (no space between number and unit). With space, use quotes: `--in "30 days"` |
|
|
86
|
+
| `--calendar` | `-c` | Calendar name or ID. Default: calendar set via `flycal calendars` |
|
|
87
|
+
| `--description` | `-d` | Filter events by text. Matches events where the string appears in the title or description (case-insensitive, contains) |
|
|
74
88
|
|
|
75
|
-
|
|
89
|
+
**Time range behavior:**
|
|
76
90
|
|
|
77
|
-
- `
|
|
78
|
-
- `
|
|
79
|
-
-
|
|
91
|
+
- If neither `--from` nor `--to` is given: searches from today at midnight to 23:59 of the 30th day from today
|
|
92
|
+
- If `--in` is given: `--to` is ignored; the end time is computed from `--from` plus the duration
|
|
93
|
+
- Examples: `--in 30days`, `--in 48hours`, `--in 1months`, `--in 1year`
|
|
80
94
|
|
|
81
|
-
|
|
95
|
+
**Output:**
|
|
82
96
|
|
|
83
|
-
|
|
97
|
+
Each event is printed as: `Calendar | Start | End | Title`
|
|
84
98
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
The summary shows:
|
|
100
|
+
- From and To dates used
|
|
101
|
+
- Number of events found
|
|
102
|
+
- Total time occupied (hours, minutes, and working days based on 8-hour days)
|
|
88
103
|
|
|
89
|
-
|
|
90
|
-
# Build della gem
|
|
91
|
-
gem build flycal-cli.gemspec
|
|
104
|
+
## Configuration
|
|
92
105
|
|
|
93
|
-
|
|
94
|
-
gem push flycal-cli-0.1.0.gem
|
|
95
|
-
```
|
|
106
|
+
Data is stored in `~/.flycal/`:
|
|
96
107
|
|
|
97
|
-
|
|
108
|
+
| File | Purpose |
|
|
109
|
+
|------|---------|
|
|
110
|
+
| `config.yml` | Default calendar ID and other settings |
|
|
111
|
+
| `credentials.json` | OAuth credentials (created manually from Google Cloud Console) |
|
|
112
|
+
| `tokens.yml` | Access tokens (managed automatically) |
|
|
98
113
|
|
|
99
|
-
|
|
100
|
-
2. Commit e tag:
|
|
114
|
+
## Publishing to RubyGems
|
|
101
115
|
|
|
102
|
-
|
|
103
|
-
git add .
|
|
104
|
-
git commit -m "Release v0.2.0"
|
|
105
|
-
git tag v0.2.0
|
|
106
|
-
git push origin main
|
|
107
|
-
git push origin v0.2.0
|
|
108
|
-
```
|
|
116
|
+
### First release
|
|
109
117
|
|
|
110
|
-
|
|
118
|
+
1. Create an account at [rubygems.org](https://rubygems.org) if needed
|
|
119
|
+
2. Update `flycal-cli.gemspec` with your author, email, and homepage
|
|
120
|
+
3. Build and push:
|
|
111
121
|
|
|
112
122
|
```bash
|
|
113
123
|
gem build flycal-cli.gemspec
|
|
114
|
-
gem push flycal-cli-0.
|
|
124
|
+
gem push flycal-cli-0.1.0.gem
|
|
115
125
|
```
|
|
116
126
|
|
|
117
|
-
###
|
|
127
|
+
### Subsequent releases
|
|
118
128
|
|
|
119
|
-
|
|
129
|
+
1. Update the version in `lib/flycal_cli/version.rb`
|
|
130
|
+
2. Build and push:
|
|
120
131
|
|
|
121
|
-
```
|
|
122
|
-
|
|
132
|
+
```bash
|
|
133
|
+
gem build flycal-cli.gemspec
|
|
134
|
+
gem push flycal-cli-X.Y.Z.gem
|
|
123
135
|
```
|
|
124
136
|
|
|
125
|
-
|
|
137
|
+
3. Optionally tag and push:
|
|
126
138
|
|
|
127
139
|
```bash
|
|
128
|
-
|
|
129
|
-
|
|
140
|
+
git tag vX.Y.Z
|
|
141
|
+
git push origin vX.Y.Z
|
|
142
|
+
```
|
|
130
143
|
|
|
131
|
-
|
|
144
|
+
### Using rake release
|
|
145
|
+
|
|
146
|
+
With `bundler/gem_tasks` in your Rakefile:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
132
149
|
bundle exec rake release
|
|
133
150
|
```
|
|
134
151
|
|
|
135
|
-
|
|
152
|
+
This builds the gem, pushes to RubyGems, and can handle git tagging and pushing.
|
|
136
153
|
|
|
137
|
-
##
|
|
154
|
+
## License
|
|
138
155
|
|
|
139
156
|
MIT
|
data/lib/flycal_cli/cli.rb
CHANGED
|
@@ -112,8 +112,8 @@ module FlycalCli
|
|
|
112
112
|
|
|
113
113
|
Examples:
|
|
114
114
|
flycal search
|
|
115
|
-
flycal search --in 30days -d
|
|
116
|
-
flycal search -i 1months --description
|
|
115
|
+
flycal search --in 30days -d placeholder
|
|
116
|
+
flycal search -i 1months --description placeholder
|
|
117
117
|
flycal search -f 2025-03-01 --in 2months
|
|
118
118
|
LONGDESC
|
|
119
119
|
option :calendar, type: :string, aliases: "-c", desc: "Calendar name or ID"
|
data/lib/flycal_cli/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flycal-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- flycal-cli
|
|
8
|
-
bindir:
|
|
8
|
+
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
@@ -104,7 +104,7 @@ extra_rdoc_files: []
|
|
|
104
104
|
files:
|
|
105
105
|
- LICENSE
|
|
106
106
|
- README.md
|
|
107
|
-
-
|
|
107
|
+
- bin/flycal
|
|
108
108
|
- lib/flycal_cli.rb
|
|
109
109
|
- lib/flycal_cli/auth.rb
|
|
110
110
|
- lib/flycal_cli/calendar_service.rb
|
/data/{exe → bin}/flycal
RENAMED
|
File without changes
|