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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8d00cb30384c0dedb985b343cbb058db6c93b6e77469d5df0d22a6ef9c62846
4
- data.tar.gz: ec29bf46d64995422a4bbf8a470035de10473bc9ceeaf2646b566347e3551d06
3
+ metadata.gz: c7e777c9b4698b273770ea0d9a70edf232ffe70f2e6bd9d32ab65818ca0f5cb5
4
+ data.tar.gz: 5d62d5fede48b31930a6a652c8b4f165a0f82315eb85e3fb5be885e56ffc2ae7
5
5
  SHA512:
6
- metadata.gz: 0ed2b407b9b51840497fc68f2842703f03b99dfa283598d2dfe9b6f324484b4fe513ec5e3a66a99c672996afba1bfcfb3c362f6514eccff6db9c5fdf06773725
7
- data.tar.gz: a8b666a01f5b52d59e7e63ed1bb2b8e894a860d27e16c7c63f66785fdc1da6f8e8fe3cf9ca4cfe0401c7f01124062ae8596ced033ce4d5380631a952c90c3ecd
6
+ metadata.gz: c1d95fcb97e10fa0c1144e15c7e205cb693d2c48847dc96569cb718c8899c5ecb3479504b4c19b3315dd8c74ecbcbc9510e99f2070a4c392ae206c51dba395dd
7
+ data.tar.gz: 6d9d08601b3d78d1aa8d3520b2f0102517b80be6ac708d0d036e3e5558d2548c1a57613f9b3121ebb12329f564a682b71843ac96b5c56a07cdf578f4dcab8f71
data/README.md CHANGED
@@ -1,139 +1,156 @@
1
1
  # flycal-cli
2
2
 
3
- CLI per accedere ai calendari Google da riga di comando.
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
- ## Installazione
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
- Oppure aggiungi al tuo Gemfile:
16
+ Or add to your Gemfile:
12
17
 
13
18
  ```ruby
14
19
  gem "flycal-cli"
15
20
  ```
16
21
 
17
- ## Configurazione iniziale
22
+ Then run `bundle install`.
23
+
24
+ ## Setup
18
25
 
19
- Prima di usare flycal, devi creare credenziali OAuth nel Google Cloud Console:
26
+ Before using flycal, you need OAuth credentials from Google Cloud Console:
20
27
 
21
- 1. Vai su [Google Cloud Console - Credenziali](https://console.cloud.google.com/apis/credentials)
22
- 2. Crea un progetto (o usa uno esistente)
23
- 3. Abilita l'**API Google Calendar** (API e serviziLibreriaCerca "Google Calendar API")
24
- 4. Crea credenziali **Applicazione desktop** (OAuth 2.0 Client IDs)
25
- 5. Aggiungi questo URI come redirect autorizzato:
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 & ServicesLibrarysearch 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. Scarica il file JSON e salvalo come `~/.flycal/credentials.json`
36
+ 6. Download the JSON file and save it as `~/.flycal/credentials.json`
30
37
 
31
- ## Comandi
38
+ ## Commands
32
39
 
33
- ### `flycal login`
40
+ ### login
34
41
 
35
- Connetti al tuo account Google. Se non sei connesso, verrà generato un link da aprire nel browser per completare l'autenticazione OAuth.
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
- ### `flycal calendars`
48
+ If already connected, the command reports the current status and suggests running `flycal calendars` to set the default calendar.
42
49
 
43
- Mostra la lista dei calendari disponibili e permette di selezionare il calendario di default. La selezione è scorrevole (usa le frecce per navigare).
50
+ ### logout
51
+
52
+ Disconnect from your Google account and remove stored tokens.
44
53
 
45
54
  ```bash
46
- flycal calendars
55
+ flycal logout
47
56
  ```
48
57
 
49
- ### `flycal logout`
58
+ ### calendars
50
59
 
51
- Disconnetti dall'account Google.
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 logout
63
+ flycal calendars
55
64
  ```
56
65
 
57
- ### `flycal search`
66
+ The default calendar is used by the search command when no calendar is specified.
67
+
68
+ ### search
58
69
 
59
- Cerca eventi nei calendari.
70
+ Search for events in your calendar(s). Supports flexible date ranges and text filtering.
60
71
 
61
72
  ```bash
62
- flycal search --from 2025-02-01 --to 2025-02-28
63
- flycal search -f 2025-02-01 -t 2025-02-28 --description "riunione"
64
- flycal search -f 2025-02-01T09:00 -t 2025-02-28T18:00 -c "Lavoro"
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
- Opzioni:
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
- ## File di configurazione
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
- I dati vengono salvati in `~/.flycal/`:
89
+ **Time range behavior:**
76
90
 
77
- - `config.yml` - calendario di default (`calendar_default`)
78
- - `credentials.json` - credenziali OAuth (da creare manualmente)
79
- - `tokens.yml` - token di accesso (gestito automaticamente)
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
- ## Pubblicazione su RubyGems
95
+ **Output:**
82
96
 
83
- ### Primo caricamento
97
+ Each event is printed as: `Calendar | Start | End | Title`
84
98
 
85
- 1. Crea un account su [rubygems.org](https://rubygems.org) se non ce l'hai
86
- 2. Aggiorna `flycal-cli.gemspec` con i tuoi dati (autori, email, homepage)
87
- 3. Build e push:
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
- ```bash
90
- # Build della gem
91
- gem build flycal-cli.gemspec
104
+ ## Configuration
92
105
 
93
- # Push (ti chiederà email e password RubyGems)
94
- gem push flycal-cli-0.1.0.gem
95
- ```
106
+ Data is stored in `~/.flycal/`:
96
107
 
97
- ### Versioni successive
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
- 1. Aggiorna la versione in `lib/flycal_cli/version.rb`
100
- 2. Commit e tag:
114
+ ## Publishing to RubyGems
101
115
 
102
- ```bash
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
- 3. Build e push:
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.2.0.gem
124
+ gem push flycal-cli-0.1.0.gem
115
125
  ```
116
126
 
117
- ### Usando `rake release` (raccomandato)
127
+ ### Subsequent releases
118
128
 
119
- Aggiungi al Rakefile:
129
+ 1. Update the version in `lib/flycal_cli/version.rb`
130
+ 2. Build and push:
120
131
 
121
- ```ruby
122
- require "bundler/gem_tasks"
132
+ ```bash
133
+ gem build flycal-cli.gemspec
134
+ gem push flycal-cli-X.Y.Z.gem
123
135
  ```
124
136
 
125
- Poi:
137
+ 3. Optionally tag and push:
126
138
 
127
139
  ```bash
128
- # Per la prima release
129
- bundle exec rake release
140
+ git tag vX.Y.Z
141
+ git push origin vX.Y.Z
142
+ ```
130
143
 
131
- # Per release successive: aggiorna VERSION e poi
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
- `rake release` esegue: build, push su RubyGems, commit, tag e push su git.
152
+ This builds the gem, pushes to RubyGems, and can handle git tagging and pushing.
136
153
 
137
- ## Licenza
154
+ ## License
138
155
 
139
156
  MIT
@@ -112,8 +112,8 @@ module FlycalCli
112
112
 
113
113
  Examples:
114
114
  flycal search
115
- flycal search --in 30days -d meeting
116
- flycal search -i 1months --description rappydrive
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"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FlycalCli
4
- VERSION = "0.2.0"
4
+ VERSION = '0.2.1'
5
5
  end
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.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - flycal-cli
8
- bindir: exe
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
- - exe/flycal
107
+ - bin/flycal
108
108
  - lib/flycal_cli.rb
109
109
  - lib/flycal_cli/auth.rb
110
110
  - lib/flycal_cli/calendar_service.rb
File without changes