logdelve 0.1.0__tar.gz

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.
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: logdelve
3
+ Version: 0.1.0
4
+ Summary: A CLI/TUI tool for viewing and filtering log lines
5
+ Author: Christian Assing
6
+ Author-email: Christian Assing <chris@ca-net.org>
7
+ License-Expression: MIT
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: System Administrators
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Topic :: System :: Logging
15
+ Classifier: Topic :: Utilities
16
+ Requires-Dist: textual>=1.0
17
+ Requires-Dist: typer>=0.9
18
+ Requires-Dist: pydantic>=2.0
19
+ Requires-Dist: aiofiles>=24.0
20
+ Requires-Dist: platformdirs>=4.0
21
+ Requires-Dist: tomli-w>=1.0
22
+ Requires-Dist: boto3>=1.42.49 ; extra == 'aws'
23
+ Requires-Python: >=3.13
24
+ Project-URL: Homepage, https://github.com/chassing/logdelve
25
+ Project-URL: Repository, https://github.com/chassing/logdelve
26
+ Project-URL: Issues, https://github.com/chassing/logdelve/issues
27
+ Provides-Extra: aws
28
+ Description-Content-Type: text/markdown
29
+
30
+ # logdelve
31
+
32
+ A terminal UI tool for viewing and filtering log lines. Think of it as a lightweight, interactive log viewer with JSON awareness.
33
+
34
+ ## Features
35
+
36
+ - **File and pipe input**: Read logs from files or pipe them via stdin
37
+ - **Timestamp parsing**: Automatic detection of ISO 8601, syslog, Apache, and other common timestamp formats
38
+ - **JSON awareness**: Detects JSON content in log lines and offers pretty-printing with syntax highlighting
39
+ - **Pretty-print toggle**: Switch between compact and expanded JSON view, globally or per-line
40
+ - **Interactive filtering**: Filter log lines by text pattern or JSON key-value pairs (include or exclude)
41
+ - **Filter management**: Reorder, toggle, delete, clear filters with a dedicated dialog
42
+ - **Session management**: Save, load, rename, delete filter sessions with auto-save
43
+ - **Live tailing**: Follow growing log files in real-time with pause/resume
44
+ - **AWS CloudWatch**: Download and list CloudWatch log groups, streams, and events
45
+
46
+ ## Installation
47
+
48
+ Requires Python 3.13+.
49
+
50
+ ```bash
51
+ # Install with uv
52
+ uv tool install logdelve
53
+
54
+ # Or install with pip
55
+ pip install logdelve
56
+
57
+ # With AWS CloudWatch support
58
+ pip install logdelve[aws]
59
+ ```
60
+
61
+ ## Commands
62
+
63
+ ### `logdelve inspect` - View log files
64
+
65
+ ```bash
66
+ # View a log file (auto-tails by default)
67
+ logdelve inspect app.log
68
+
69
+ # Pipe logs from another command
70
+ kubectl logs pod-name | logdelve inspect
71
+
72
+ # Disable automatic tailing
73
+ logdelve inspect --no-tail app.log
74
+
75
+ # Load a saved filter session
76
+ logdelve inspect --session my-filters app.log
77
+ ```
78
+
79
+ ### `logdelve cloudwatch` - AWS CloudWatch logs
80
+
81
+ Requires `logdelve[aws]` (boto3).
82
+
83
+ ```bash
84
+ # List log groups
85
+ logdelve cloudwatch groups
86
+ logdelve cloudwatch groups /aws/lambda/
87
+
88
+ # List streams for a log group
89
+ logdelve cloudwatch streams /aws/lambda/my-function
90
+
91
+ # Download recent logs (last 5 minutes by default)
92
+ logdelve cloudwatch get /aws/lambda/my-function stream-prefix
93
+
94
+ # Download with time range
95
+ logdelve cloudwatch get /aws/lambda/my-function prefix -s 1h -e 30m
96
+
97
+ # Download and view in TUI
98
+ logdelve cloudwatch get /aws/lambda/my-function prefix | logdelve inspect
99
+
100
+ # Tail CloudWatch logs live
101
+ logdelve cloudwatch get /aws/lambda/my-function prefix --tail | logdelve inspect
102
+ ```
103
+
104
+ Time formats for `--start`/`--end`: `5m`, `1h`, `2d`, `1week`, `14:30`, or ISO 8601. All times in UTC.
105
+
106
+ AWS credentials via `--profile`, `--aws-region`, `--aws-access-key-id`, etc. or standard environment variables.
107
+
108
+ ## Keybindings
109
+
110
+ ### Navigation
111
+
112
+ | Key | Action |
113
+ | ----------- | ------------------------- |
114
+ | Up / Down | Move between log lines |
115
+ | PgUp / PgDn | Page up / down |
116
+ | Home / End | Jump to first / last line |
117
+ | gg | Jump to first line |
118
+ | G | Jump to last line |
119
+
120
+ ### JSON Display
121
+
122
+ | Key | Action |
123
+ | ----- | ------------------------------------------------- |
124
+ | j | Toggle pretty-print for ALL JSON lines |
125
+ | Enter | Toggle pretty-print for the current line (sticky) |
126
+ | n | Toggle line numbers |
127
+
128
+ ### Filtering
129
+
130
+ | Key | Action |
131
+ | --- | ----------------------------------------------- |
132
+ | / | Filter in (text or key=value) |
133
+ | \ | Filter out (text or key=value) |
134
+ | m | Manage filters (toggle, delete, clear, reorder) |
135
+ | 1-9 | Toggle individual filters on/off |
136
+
137
+ On JSON lines, `/` and `\` show key-value suggestions.
138
+
139
+ ### Tailing
140
+
141
+ | Key | Action |
142
+ | --- | --------------------------------- |
143
+ | p | Pause/resume tailing |
144
+ | G | Jump to bottom (follow new lines) |
145
+
146
+ ### Sessions
147
+
148
+ | Key | Action |
149
+ | --- | --------------------------------------------------- |
150
+ | s | Session manager (load, save, delete, rename) |
151
+
152
+ ### General
153
+
154
+ | Key | Action |
155
+ | ---- | ---------------- |
156
+ | h, ? | Show help screen |
157
+ | q | Quit |
158
+
159
+ ## Log Format
160
+
161
+ logdelve expects each line to begin with a timestamp, followed by either a JSON object or plain text:
162
+
163
+ ```text
164
+ 2024-01-15T10:30:00Z {"log_level": "info", "message": "Request processed", "duration_ms": 42}
165
+ 2024-01-15T10:30:01Z Connection established from 192.168.1.1
166
+ Jan 15 10:30:02 myhost syslogd: restart
167
+ ```
168
+
169
+ Lines without a recognized timestamp are displayed as-is.
170
+
171
+ ## Sessions
172
+
173
+ Filter sessions are stored in `~/.config/logdelve/sessions/` as TOML files. Filters are auto-saved on every change. Use `--session` to load a session on startup.
174
+
175
+ ## Development
176
+
177
+ ```bash
178
+ # Clone the repo
179
+ git clone https://github.com/chassing/logdelve.git
180
+ cd logdelve
181
+
182
+ # Install dependencies
183
+ uv sync
184
+
185
+ # Run from source
186
+ uv run logdelve inspect sample.log
187
+
188
+ # Run all checks (lint, format, typecheck, tests)
189
+ make test
190
+
191
+ # Individual targets
192
+ make lint # ruff check
193
+ make format # ruff format
194
+ make typecheck # mypy
195
+ make clean # remove caches
196
+ ```
197
+
198
+ ## Releasing
199
+
200
+ 1. Update version in `pyproject.toml`
201
+ 2. Update `CHANGELOG.md`
202
+ 3. Commit and push: `git commit -am "Release vX.Y.Z" && git push`
203
+ 4. Create a GitHub release: `gh release create vX.Y.Z --title "vX.Y.Z" --notes "See CHANGELOG.md"`
204
+ 5. The `publish.yml` workflow builds and publishes to PyPI automatically
205
+
206
+ Requires `PYPI_TOKEN` secret in the GitHub repo settings.
207
+
208
+ ## License
209
+
210
+ MIT
@@ -0,0 +1,181 @@
1
+ # logdelve
2
+
3
+ A terminal UI tool for viewing and filtering log lines. Think of it as a lightweight, interactive log viewer with JSON awareness.
4
+
5
+ ## Features
6
+
7
+ - **File and pipe input**: Read logs from files or pipe them via stdin
8
+ - **Timestamp parsing**: Automatic detection of ISO 8601, syslog, Apache, and other common timestamp formats
9
+ - **JSON awareness**: Detects JSON content in log lines and offers pretty-printing with syntax highlighting
10
+ - **Pretty-print toggle**: Switch between compact and expanded JSON view, globally or per-line
11
+ - **Interactive filtering**: Filter log lines by text pattern or JSON key-value pairs (include or exclude)
12
+ - **Filter management**: Reorder, toggle, delete, clear filters with a dedicated dialog
13
+ - **Session management**: Save, load, rename, delete filter sessions with auto-save
14
+ - **Live tailing**: Follow growing log files in real-time with pause/resume
15
+ - **AWS CloudWatch**: Download and list CloudWatch log groups, streams, and events
16
+
17
+ ## Installation
18
+
19
+ Requires Python 3.13+.
20
+
21
+ ```bash
22
+ # Install with uv
23
+ uv tool install logdelve
24
+
25
+ # Or install with pip
26
+ pip install logdelve
27
+
28
+ # With AWS CloudWatch support
29
+ pip install logdelve[aws]
30
+ ```
31
+
32
+ ## Commands
33
+
34
+ ### `logdelve inspect` - View log files
35
+
36
+ ```bash
37
+ # View a log file (auto-tails by default)
38
+ logdelve inspect app.log
39
+
40
+ # Pipe logs from another command
41
+ kubectl logs pod-name | logdelve inspect
42
+
43
+ # Disable automatic tailing
44
+ logdelve inspect --no-tail app.log
45
+
46
+ # Load a saved filter session
47
+ logdelve inspect --session my-filters app.log
48
+ ```
49
+
50
+ ### `logdelve cloudwatch` - AWS CloudWatch logs
51
+
52
+ Requires `logdelve[aws]` (boto3).
53
+
54
+ ```bash
55
+ # List log groups
56
+ logdelve cloudwatch groups
57
+ logdelve cloudwatch groups /aws/lambda/
58
+
59
+ # List streams for a log group
60
+ logdelve cloudwatch streams /aws/lambda/my-function
61
+
62
+ # Download recent logs (last 5 minutes by default)
63
+ logdelve cloudwatch get /aws/lambda/my-function stream-prefix
64
+
65
+ # Download with time range
66
+ logdelve cloudwatch get /aws/lambda/my-function prefix -s 1h -e 30m
67
+
68
+ # Download and view in TUI
69
+ logdelve cloudwatch get /aws/lambda/my-function prefix | logdelve inspect
70
+
71
+ # Tail CloudWatch logs live
72
+ logdelve cloudwatch get /aws/lambda/my-function prefix --tail | logdelve inspect
73
+ ```
74
+
75
+ Time formats for `--start`/`--end`: `5m`, `1h`, `2d`, `1week`, `14:30`, or ISO 8601. All times in UTC.
76
+
77
+ AWS credentials via `--profile`, `--aws-region`, `--aws-access-key-id`, etc. or standard environment variables.
78
+
79
+ ## Keybindings
80
+
81
+ ### Navigation
82
+
83
+ | Key | Action |
84
+ | ----------- | ------------------------- |
85
+ | Up / Down | Move between log lines |
86
+ | PgUp / PgDn | Page up / down |
87
+ | Home / End | Jump to first / last line |
88
+ | gg | Jump to first line |
89
+ | G | Jump to last line |
90
+
91
+ ### JSON Display
92
+
93
+ | Key | Action |
94
+ | ----- | ------------------------------------------------- |
95
+ | j | Toggle pretty-print for ALL JSON lines |
96
+ | Enter | Toggle pretty-print for the current line (sticky) |
97
+ | n | Toggle line numbers |
98
+
99
+ ### Filtering
100
+
101
+ | Key | Action |
102
+ | --- | ----------------------------------------------- |
103
+ | / | Filter in (text or key=value) |
104
+ | \ | Filter out (text or key=value) |
105
+ | m | Manage filters (toggle, delete, clear, reorder) |
106
+ | 1-9 | Toggle individual filters on/off |
107
+
108
+ On JSON lines, `/` and `\` show key-value suggestions.
109
+
110
+ ### Tailing
111
+
112
+ | Key | Action |
113
+ | --- | --------------------------------- |
114
+ | p | Pause/resume tailing |
115
+ | G | Jump to bottom (follow new lines) |
116
+
117
+ ### Sessions
118
+
119
+ | Key | Action |
120
+ | --- | --------------------------------------------------- |
121
+ | s | Session manager (load, save, delete, rename) |
122
+
123
+ ### General
124
+
125
+ | Key | Action |
126
+ | ---- | ---------------- |
127
+ | h, ? | Show help screen |
128
+ | q | Quit |
129
+
130
+ ## Log Format
131
+
132
+ logdelve expects each line to begin with a timestamp, followed by either a JSON object or plain text:
133
+
134
+ ```text
135
+ 2024-01-15T10:30:00Z {"log_level": "info", "message": "Request processed", "duration_ms": 42}
136
+ 2024-01-15T10:30:01Z Connection established from 192.168.1.1
137
+ Jan 15 10:30:02 myhost syslogd: restart
138
+ ```
139
+
140
+ Lines without a recognized timestamp are displayed as-is.
141
+
142
+ ## Sessions
143
+
144
+ Filter sessions are stored in `~/.config/logdelve/sessions/` as TOML files. Filters are auto-saved on every change. Use `--session` to load a session on startup.
145
+
146
+ ## Development
147
+
148
+ ```bash
149
+ # Clone the repo
150
+ git clone https://github.com/chassing/logdelve.git
151
+ cd logdelve
152
+
153
+ # Install dependencies
154
+ uv sync
155
+
156
+ # Run from source
157
+ uv run logdelve inspect sample.log
158
+
159
+ # Run all checks (lint, format, typecheck, tests)
160
+ make test
161
+
162
+ # Individual targets
163
+ make lint # ruff check
164
+ make format # ruff format
165
+ make typecheck # mypy
166
+ make clean # remove caches
167
+ ```
168
+
169
+ ## Releasing
170
+
171
+ 1. Update version in `pyproject.toml`
172
+ 2. Update `CHANGELOG.md`
173
+ 3. Commit and push: `git commit -am "Release vX.Y.Z" && git push`
174
+ 4. Create a GitHub release: `gh release create vX.Y.Z --title "vX.Y.Z" --notes "See CHANGELOG.md"`
175
+ 5. The `publish.yml` workflow builds and publishes to PyPI automatically
176
+
177
+ Requires `PYPI_TOKEN` secret in the GitHub repo settings.
178
+
179
+ ## License
180
+
181
+ MIT
@@ -0,0 +1,68 @@
1
+ [project]
2
+ name = "logdelve"
3
+ version = "0.1.0"
4
+ description = "A CLI/TUI tool for viewing and filtering log lines"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ authors = [{ name = "Christian Assing", email = "chris@ca-net.org" }]
8
+ requires-python = ">=3.13"
9
+ dependencies = [
10
+ "textual>=1.0",
11
+ "typer>=0.9",
12
+ "pydantic>=2.0",
13
+ "aiofiles>=24.0",
14
+ "platformdirs>=4.0",
15
+ "tomli-w>=1.0",
16
+ ]
17
+
18
+ classifiers = [
19
+ "Development Status :: 4 - Beta",
20
+ "Environment :: Console",
21
+ "Intended Audience :: Developers",
22
+ "Intended Audience :: System Administrators",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Topic :: System :: Logging",
26
+ "Topic :: Utilities",
27
+ ]
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/chassing/logdelve"
31
+ Repository = "https://github.com/chassing/logdelve"
32
+ Issues = "https://github.com/chassing/logdelve/issues"
33
+
34
+ [project.scripts]
35
+ logdelve = "logdelve.cli:main"
36
+
37
+ [project.optional-dependencies]
38
+ aws = ["boto3>=1.42.49"]
39
+
40
+ [build-system]
41
+ requires = ["uv_build>=0.10.2,<0.11.0"]
42
+ build-backend = "uv_build"
43
+
44
+ [dependency-groups]
45
+ dev = [
46
+ "boto3>=1.42.49",
47
+ "pytest>=8.0",
48
+ "pytest-asyncio>=0.24",
49
+ "textual-dev>=1.0",
50
+ "ruff>=0.8",
51
+ "mypy>=1.0",
52
+ "types-aiofiles>=25.1.0.20251011",
53
+ "boto3-stubs[logs]>=1.42.49",
54
+ ]
55
+
56
+ [tool.ruff]
57
+ line-length = 120
58
+ target-version = "py313"
59
+
60
+ [tool.ruff.lint]
61
+ select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
62
+
63
+ [tool.mypy]
64
+ python_version = "3.13"
65
+ strict = true
66
+
67
+ [tool.pytest.ini_options]
68
+ testpaths = ["tests"]
@@ -0,0 +1,3 @@
1
+ """logdelve - A CLI/TUI tool for viewing and filtering log lines."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,5 @@
1
+ """Entry point for python -m logdelve."""
2
+
3
+ from logdelve.cli import main
4
+
5
+ main()