codefetch-cli 1.2.1__py3-none-any.whl → 1.2.2__py3-none-any.whl

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.
codefetch/__init__.py CHANGED
@@ -2,4 +2,4 @@
2
2
  CodeFetch - CLI tool to fetch code files from GitHub repositories.
3
3
  """
4
4
 
5
- __version__ = "1.2.1"
5
+ __version__ = "1.2.2"
codefetch/cli.py CHANGED
@@ -12,8 +12,8 @@ import urllib.error
12
12
  import urllib.request
13
13
  from pathlib import Path
14
14
 
15
- DEFAULT_OWNER = "Reaver101"
16
- DEFAULT_REPO = "MPL"
15
+ DEFAULT_OWNER = None
16
+ DEFAULT_REPO = None
17
17
  DEFAULT_BRANCH = "main"
18
18
 
19
19
  CONFIG_FILE = Path.home() / ".codefetch.json"
@@ -55,42 +55,37 @@ HELP_MESSAGE = """\
55
55
  CodeFetch - Download single code files from GitHub without cloning entire repos.
56
56
 
57
57
  USAGE:
58
- codefetch <filename> Download a file from default repo (MPL)
59
- codefetch <repo> <filename> Download from another repo (e.g. DS EXP1.c)
60
- codefetch <user>/<repo> <filename> Download from any GitHub user/repo
58
+ codefetch <owner>/<repo> <filename> Download a file from any GitHub repository
59
+ codefetch <filename> Download a file (requires default repository)
61
60
 
62
61
  QUICK EXAMPLES:
63
62
  Download a file:
64
- codefetch 8.1.py Save 8.1.py to current directory
65
- codefetch data.csv Save data.csv to current directory
66
- codefetch DS EXP1.c Save EXP1.c from repo 'DS'
67
- codefetch DS EXP1.c -o my_code.c Save with a custom output filename
68
- codefetch InzamamulQureshi/Codefetch setup.py
63
+ codefetch torvalds/linux Makefile Save Makefile to current directory
64
+ codefetch owner/repo main.py Save main.py from a repository
65
+ codefetch owner/repo data.csv -o out.csv Save with a custom output filename
69
66
 
70
67
  View code in terminal (without downloading):
71
- codefetch -s 8.1.py Display 8.1.py in terminal
72
- codefetch -s DS EXP1.c Display EXP1.c in terminal
68
+ codefetch -s owner/repo main.py Display main.py in terminal
69
+ codefetch -s torvalds/linux Makefile Display Makefile in terminal
73
70
 
74
71
  Browse files and repositories:
75
- codefetch -l List all code files in default repo (MPL)
76
- codefetch -l DS List all code files in repo 'DS'
77
- codefetch -l user/repo List code files in any user repository
78
- codefetch -R List all repositories of default user (Reaver101)
79
- codefetch -R -u <username> List all repositories of any GitHub user
80
-
81
- SETTINGS & DEFAULTS:
82
- codefetch --set-default <repo> Set permanent default repo (e.g. DS)
83
- codefetch --set-default-user <user> Set permanent default GitHub user
84
- codefetch --config View current active settings
85
- codefetch --reset-config Reset all settings back to default
72
+ codefetch -l owner/repo List all code files in a repository
73
+ codefetch -R -u <username> List all public repositories of a user
74
+ codefetch -R <username> List all public repositories of a user
75
+
76
+ SETTINGS & DEFAULTS (Optional):
77
+ codefetch --set-default <owner/repo> Set a permanent default repository
78
+ codefetch --set-default-user <username> Set a permanent default GitHub user
79
+ codefetch --config View current saved settings
80
+ codefetch --reset-config Clear saved settings
86
81
 
87
82
  OPTIONS:
88
83
  -s, --show View file contents in terminal instead of saving
89
84
  -o, --output <file> Custom filename or path to save the downloaded file
90
- -l, --list List available code files in the repository
91
- -R, --repos List all public repositories for the user
85
+ -l, --list [repo] List available code files in a repository
86
+ -R, --repos [user] List all public repositories for a user
92
87
  -r, --repo <name> Specify repository name or URL
93
- -u, --user <name> Specify GitHub username (default: Reaver101)
88
+ -u, --user <name> Specify GitHub username
94
89
  -b, --branch <name> Specify branch name (default: main)
95
90
  -v, --version Show version number
96
91
  -h, --help Show this help guide
@@ -157,7 +152,7 @@ def get_json(url):
157
152
  return json.loads(response.read().decode("utf-8"))
158
153
 
159
154
 
160
- def parse_repo_identifier(repo_str, default_owner=DEFAULT_OWNER):
155
+ def parse_repo_identifier(repo_str, default_owner=None):
161
156
  """Extract (owner, repo) from a repository flag, name, or URL."""
162
157
  if not repo_str:
163
158
  return default_owner, None
@@ -199,8 +194,15 @@ def get_user_repos(owner):
199
194
  return []
200
195
 
201
196
 
202
- def list_repos(owner=DEFAULT_OWNER, default_repo=DEFAULT_REPO):
197
+ def list_repos(owner=None, default_repo=None):
203
198
  """List all public repositories for the owner."""
199
+ if not owner:
200
+ print("Error: No GitHub user specified.\n")
201
+ print("Usage:")
202
+ print(" codefetch -R <username>")
203
+ print(" codefetch -R -u <username>")
204
+ return
205
+
204
206
  try:
205
207
  repos = get_user_repos(owner)
206
208
  if not repos:
@@ -211,15 +213,15 @@ def list_repos(owner=DEFAULT_OWNER, default_repo=DEFAULT_REPO):
211
213
  for r in repos:
212
214
  name = r.get("name", "")
213
215
  desc = r.get("description") or ""
214
- is_def = " (default)" if name.lower() == default_repo.lower() else ""
216
+ is_def = " (default)" if default_repo and name.lower() == default_repo.lower() else ""
215
217
  marker = "*" if is_def else "-"
216
218
  desc_text = f" - {desc}" if desc else ""
217
219
  print(f" {marker} {name}{is_def}{desc_text}")
218
220
 
219
221
  print("\nCommands:")
220
- print(f" codefetch -u {owner} -r <repo> --list List files in a repository")
221
- print(f" codefetch -u {owner} -r <repo> <filename> Download a file from a repository")
222
- print(f" codefetch --set-default <repo> Set default repository")
222
+ print(f" codefetch -l {owner}/<repo> List files in a repository")
223
+ print(f" codefetch {owner}/<repo> <filename> Download a file from a repository")
224
+ print(f" codefetch --set-default {owner}/<repo> Set default repository")
223
225
 
224
226
  except urllib.error.HTTPError as e:
225
227
  print(f"Could not list repositories: HTTP {e.code}")
@@ -231,6 +233,13 @@ def list_repos(owner=DEFAULT_OWNER, default_repo=DEFAULT_REPO):
231
233
 
232
234
  def list_files(owner, repo, branch="main"):
233
235
  """List code files in a repository."""
236
+ if not owner or not repo:
237
+ print("Error: No repository specified to list.\n")
238
+ print("Usage:")
239
+ print(" codefetch -l <owner>/<repo>")
240
+ print(" codefetch -u <owner> -r <repo> -l")
241
+ return
242
+
234
243
  try:
235
244
  data = get_repo_tree(owner, repo, branch)
236
245
  if data.get("truncated"):
@@ -284,7 +293,7 @@ def resolve_file_in_tree(tree_data, target_filename):
284
293
  Search tree for target_filename:
285
294
  1. Exact match (case-insensitive) on full path
286
295
  2. Exact match (case-insensitive) on basename
287
- 3. Match without extension (e.g. 'exp1' -> 'EXP1.c')
296
+ 3. Match without extension (e.g. 'main' -> 'main.py')
288
297
  """
289
298
  blobs = [item["path"] for item in tree_data.get("tree", []) if item.get("type") == "blob"]
290
299
  target_clean = target_filename.strip("/\\").lower()
@@ -318,11 +327,13 @@ def resolve_file_in_tree(tree_data, target_filename):
318
327
 
319
328
  def find_file_in_other_repos(owner, current_repo, target_filename):
320
329
  """Search other public repositories of the user for the target file."""
330
+ if not owner:
331
+ return None, None
321
332
  try:
322
333
  repos_data = get_user_repos(owner)
323
334
  for r in repos_data:
324
335
  r_name = r.get("name")
325
- if not r_name or r_name.lower() == current_repo.lower():
336
+ if not r_name or (current_repo and r_name.lower() == current_repo.lower()):
326
337
  continue
327
338
  default_branch = r.get("default_branch", "main")
328
339
  try:
@@ -337,9 +348,19 @@ def find_file_in_other_repos(owner, current_repo, target_filename):
337
348
  return None, None
338
349
 
339
350
 
340
- def fetch_file(filename, owner=DEFAULT_OWNER, repo=DEFAULT_REPO, branch=DEFAULT_BRANCH,
351
+ def fetch_file(filename, owner=None, repo=None, branch=DEFAULT_BRANCH,
341
352
  show=False, output=None):
342
353
  """Fetch or download a file from GitHub."""
354
+ if not owner or not repo:
355
+ print("Error: No GitHub repository specified.\n")
356
+ print("Usage:")
357
+ print(" codefetch <owner>/<repo> <filename>")
358
+ print(" codefetch -u <owner> -r <repo> <filename>\n")
359
+ print("To set a default repository:")
360
+ print(" codefetch --set-default <owner>/<repo>\n")
361
+ print("Run 'codefetch --help' for more options.")
362
+ return
363
+
343
364
  clean_filename = filename.strip("/\\")
344
365
 
345
366
  def download_url(url):
@@ -373,11 +394,11 @@ def fetch_file(filename, owner=DEFAULT_OWNER, repo=DEFAULT_REPO, branch=DEFAULT_
373
394
  if other_repo:
374
395
  print(f"File not found: '{clean_filename}' in {owner}/{repo}.")
375
396
  print(f"\n[Tip] Found '{other_match}' in repository '{other_repo}'!")
376
- print(f"To fetch it, run:\n codefetch -u {owner} -r {other_repo} {other_match}")
397
+ print(f"To fetch it, run:\n codefetch {owner}/{other_repo} {other_match}")
377
398
  return
378
399
  else:
379
400
  print(f"File not found: '{clean_filename}' in {owner}/{repo}.")
380
- print(f"Run 'codefetch -u {owner} -r {repo} --list' to see available files.")
401
+ print(f"Run 'codefetch -l {owner}/{repo}' to see available files.")
381
402
  return
382
403
  except Exception:
383
404
  print(f"File not found: '{clean_filename}' in {owner}/{repo}.")
@@ -427,17 +448,17 @@ def build_parser():
427
448
  parser.add_argument(
428
449
  "args",
429
450
  nargs="*",
430
- help="Target specification: [user/repo] [filename] or [filename]",
451
+ help="Target specification: <owner>/<repo> <filename> or <filename>",
431
452
  )
432
453
  parser.add_argument(
433
454
  "-r", "--repo",
434
455
  default=None,
435
- help="Repository name or URL (e.g. DS, Codefetch, or user/repo)",
456
+ help="Repository name or URL (e.g. repo or owner/repo)",
436
457
  )
437
458
  parser.add_argument(
438
459
  "-u", "--user",
439
460
  default=None,
440
- help=f"GitHub user/org (default: {DEFAULT_OWNER})",
461
+ help="GitHub user/org name",
441
462
  )
442
463
  parser.add_argument(
443
464
  "-b", "--branch",
@@ -452,7 +473,7 @@ def build_parser():
452
473
  parser.add_argument(
453
474
  "-R", "--repos",
454
475
  action="store_true",
455
- help="List all public repositories for the user",
476
+ help="List all public repositories for a user",
456
477
  )
457
478
  parser.add_argument(
458
479
  "-s", "--show",
@@ -487,13 +508,13 @@ def build_parser():
487
508
  parser.add_argument(
488
509
  "-v", "--version",
489
510
  action="version",
490
- version="codefetch 1.2.1",
511
+ version="codefetch 1.2.2",
491
512
  )
492
513
  return parser
493
514
 
494
515
 
495
516
  def resolve_invocation(positional_args, repo_flag, user_flag, branch_flag,
496
- default_owner, default_repo, default_branch, known_repos=None):
517
+ default_owner, default_repo, default_branch):
497
518
  """
498
519
  Resolve arguments into (owner, repo, branch, filename).
499
520
  """
@@ -530,7 +551,7 @@ def resolve_invocation(positional_args, repo_flag, user_flag, branch_flag,
530
551
  if m:
531
552
  return m.group(1), m.group(2), m.group(3), m.group(4)
532
553
 
533
- # 3. Colon syntax: user/repo:filename or repo:filename
554
+ # 3. Colon syntax: user/repo:filename
534
555
  if ":" in target:
535
556
  repo_part, file_part = target.split(":", 1)
536
557
  p_owner, p_repo = parse_repo_identifier(repo_part, default_owner=owner)
@@ -542,9 +563,12 @@ def resolve_invocation(positional_args, repo_flag, user_flag, branch_flag,
542
563
  return parts[0], parts[1], branch, "/".join(parts[2:])
543
564
 
544
565
  if len(parts) == 2:
545
- return owner, parts[0], branch, parts[1]
566
+ if owner:
567
+ return owner, parts[0], branch, parts[1]
568
+ else:
569
+ return parts[0], parts[1], branch, None
546
570
 
547
- # Single filename, e.g. 8.1.py
571
+ # Single filename, e.g. main.py (requires default_owner and default_repo)
548
572
  return owner, repo, branch, target
549
573
 
550
574
 
@@ -565,7 +589,7 @@ def main():
565
589
  except Exception as e:
566
590
  print(f"Error removing config file: {e}")
567
591
  return
568
- print(f"Configuration reset to defaults (User: {DEFAULT_OWNER}, Repo: {DEFAULT_REPO}).")
592
+ print("Configuration reset to defaults (no default repository or user).")
569
593
  return
570
594
 
571
595
  # Handle --set-default-user
@@ -577,9 +601,10 @@ def main():
577
601
 
578
602
  # Handle --set-default
579
603
  if args.set_default:
580
- owner_to_save = args.user if args.user else None
581
- save_config(owner=owner_to_save, repo=args.set_default)
582
- print(f"Default repository updated to: '{args.set_default}'")
604
+ owner_part, repo_part = parse_repo_identifier(args.set_default, default_owner=args.user)
605
+ owner_to_save = owner_part or (args.user if args.user else None)
606
+ save_config(owner=owner_to_save, repo=repo_part)
607
+ print(f"Default repository updated to: '{repo_part}'")
583
608
  if owner_to_save:
584
609
  print(f"Default user updated to: '{owner_to_save}'")
585
610
  print(f"Saved to: {CONFIG_FILE}")
@@ -588,8 +613,8 @@ def main():
588
613
  # Handle --config
589
614
  if args.config:
590
615
  print("CodeFetch Configuration:")
591
- print(f" Default User: {default_owner}")
592
- print(f" Default Repository: {default_repo}")
616
+ print(f" Default User: {default_owner or 'None (not set)'}")
617
+ print(f" Default Repository: {default_repo or 'None (not set)'}")
593
618
  print(f" Default Branch: {default_branch}")
594
619
  print(f" Config File: {CONFIG_FILE}")
595
620
  return
@@ -602,6 +627,12 @@ def main():
602
627
  target_owner = owner
603
628
  if args.args:
604
629
  target_owner = args.args[0]
630
+ if not target_owner:
631
+ print("Error: No GitHub user specified.\n")
632
+ print("Usage:")
633
+ print(" codefetch --repos <username>")
634
+ print(" codefetch -R -u <username>")
635
+ return
605
636
  list_repos(owner=target_owner, default_repo=default_repo)
606
637
  return
607
638
 
@@ -613,6 +644,12 @@ def main():
613
644
  target_owner, target_repo = parse_repo_identifier(args.repo, default_owner=owner)
614
645
  elif args.args:
615
646
  target_owner, target_repo = parse_repo_identifier(args.args[0], default_owner=owner)
647
+ if not target_owner or not target_repo:
648
+ print("Error: No repository specified to list.\n")
649
+ print("Usage:")
650
+ print(" codefetch -l <owner>/<repo>")
651
+ print(" codefetch -u <owner> -r <repo> -l")
652
+ return
616
653
  list_files(owner=target_owner, repo=target_repo, branch=branch)
617
654
  return
618
655
 
@@ -621,8 +658,6 @@ def main():
621
658
  parser.print_help()
622
659
  return
623
660
 
624
- known_repos = [default_repo, "DS", "MPL", "Discord-Chatbot", "Codefetch"]
625
-
626
661
  resolved_owner, resolved_repo, resolved_branch, resolved_filename = resolve_invocation(
627
662
  args.args,
628
663
  args.repo,
@@ -631,14 +666,12 @@ def main():
631
666
  default_owner,
632
667
  default_repo,
633
668
  default_branch,
634
- known_repos=known_repos,
635
669
  )
636
670
 
637
671
  if not resolved_filename:
638
672
  print("Error: No filename specified.\n")
639
673
  print("Usage:")
640
- print(" codefetch <filename> Download a file")
641
- print(" codefetch <repo> <filename> Download from a repository")
674
+ print(" codefetch <owner>/<repo> <filename>")
642
675
  print(" codefetch --help View full guide and examples")
643
676
  return
644
677
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codefetch-cli
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: Quickly fetch code files from GitHub repositories with simple commands
5
5
  Home-page: https://github.com/InzamamulQureshi/Codefetch
6
6
  Author: Inzamamul Qureshi
@@ -30,13 +30,13 @@ CodeFetch is a lightweight command-line utility designed to quickly inspect, pre
30
30
 
31
31
  ## Features
32
32
 
33
- - **Any User & Repository**: Fetch files from any public GitHub repository using intuitive syntax (`codefetch <user>/<repo> <filename>`).
33
+ - **Any User & Repository**: Fetch files from any public GitHub repository using intuitive syntax (`codefetch <owner>/<repo> <filename>`).
34
34
  - **Terminal Preview**: Inspect code directly in your console with `--show` without saving it to disk.
35
- - **Automatic Path & Case Resolution**: Automatically resolves case mismatches (e.g., `exp1.c` -> `EXP1.c`) and finds files nested inside subdirectories.
35
+ - **Automatic Path & Case Resolution**: Automatically resolves case mismatches and finds files nested inside subdirectories.
36
36
  - **Repository Discovery**: List all public repositories for any GitHub user with `--repos`.
37
37
  - **Tree Exploration**: List all supported code files within a repository with `--list`.
38
- - **Persistent Defaults**: Configure your preferred default repository and user with `--set-default` and `--set-default-user`.
39
- - **No Dependencies**: Built using the Python standard library with zero third-party runtime dependencies.
38
+ - **Optional Persistent Defaults**: Save a default repository or user with `--set-default` if you frequently work with the same repository.
39
+ - **Zero Runtime Dependencies**: Built using only the Python standard library with zero third-party dependencies.
40
40
 
41
41
  ---
42
42
 
@@ -70,80 +70,61 @@ pip install .
70
70
 
71
71
  ### 1. Download Files
72
72
 
73
- Fetch a file from any GitHub repository:
73
+ Fetch a single file from any GitHub repository:
74
74
 
75
75
  ```bash
76
- # Fetch from a specific user and repository
77
- codefetch InzamamulQureshi/Codefetch setup.py
76
+ # Fetch a file from any user and repository
77
+ codefetch owner/repo main.py
78
78
 
79
- # Fetch using explicit flags
80
- codefetch -u InzamamulQureshi -r Codefetch setup.py
79
+ # Download a configuration or dataset
80
+ codefetch owner/repo data.csv
81
+ codefetch owner/repo config.yaml
81
82
 
82
- # Fetch from a repository under the default user
83
- codefetch DS EXP1.c
84
- codefetch -r DS EXP1.c
83
+ # Download using explicit flags
84
+ codefetch -u owner -r repo main.py
85
85
 
86
- # Shorthand path syntax
87
- codefetch DS/EXP1.c
88
-
89
- # Fetch from the default repository
90
- codefetch 8.1.py
91
- ```
92
-
93
- Save to a custom filename or directory using `-o` / `--output`:
94
-
95
- ```bash
96
- codefetch -r DS EXP1.c -o my_experiment.c
86
+ # Save with a custom filename or destination path
87
+ codefetch owner/repo main.py -o custom_name.py
97
88
  ```
98
89
 
99
90
  ### 2. Preview in Terminal (Without Downloading)
100
91
 
101
- Display the contents of a file directly in stdout:
92
+ Display the contents of a file directly in stdout with `-s` / `--show`:
102
93
 
103
94
  ```bash
104
- # Preview file from default repository
105
- codefetch --show 8.1.py
106
-
107
- # Preview file from another repository
108
- codefetch --show DS/EXP1.c
109
-
110
- # Preview file from any user repository
111
- codefetch --show InzamamulQureshi/Codefetch setup.py
95
+ # Preview file content in terminal
96
+ codefetch -s owner/repo main.py
97
+ codefetch -s torvalds/linux Makefile
112
98
  ```
113
99
 
114
100
  ### 3. Explore Repositories and Files
115
101
 
116
102
  ```bash
117
- # List all public repositories for default user
118
- codefetch --repos
119
-
120
- # List all public repositories for a specific user
121
- codefetch --repos -u InzamamulQureshi
122
- codefetch --repos torvalds
103
+ # List all code files in a repository
104
+ codefetch -l owner/repo
105
+ codefetch --list owner/repo
123
106
 
124
- # List code files in the default repository
125
- codefetch --list
126
-
127
- # List code files in another repository
128
- codefetch -r DS --list
129
- codefetch --list InzamamulQureshi/Codefetch
107
+ # List all public repositories for any GitHub user
108
+ codefetch -R -u username
109
+ codefetch --repos username
130
110
  ```
131
111
 
132
- ### 4. Configuration and Defaults
112
+ ### 4. Configuration and Defaults (Optional)
133
113
 
134
- Set persistent default preferences stored in `~/.codefetch.json`:
114
+ By default, CodeFetch has no preset repository or user. If you frequently fetch files from the same repository, you can optionally configure defaults:
135
115
 
136
116
  ```bash
137
- # Set default repository
138
- codefetch --set-default DS
117
+ # Set a default repository (saves both user and repo)
118
+ codefetch --set-default owner/repo
139
119
 
140
- # Set default user
141
- codefetch --set-default-user InzamamulQureshi
120
+ # Now you can fetch files directly without typing the repo name!
121
+ codefetch main.py
122
+ codefetch -l
142
123
 
143
- # View current configuration
124
+ # View current saved configuration
144
125
  codefetch --config
145
126
 
146
- # Reset configuration back to factory defaults
127
+ # Reset all configuration back to defaults (no default repository)
147
128
  codefetch --reset-config
148
129
  ```
149
130
 
@@ -153,17 +134,17 @@ codefetch --reset-config
153
134
 
154
135
  | Flag | Description | Example |
155
136
  |---|---|---|
156
- | `-r`, `--repo` | Target repository name or URL | `codefetch -r DS EXP1.c` |
157
- | `-u`, `--user` | Target GitHub user or organization | `codefetch -u octocat -r Spoon-Knife --list` |
158
- | `-b`, `--branch` | Branch name (default: `main`) | `codefetch -b main DS EXP1.c` |
159
- | `-s`, `--show` | Print file contents to terminal | `codefetch --show 8.1.py` |
160
- | `-l`, `--list` | List available code files | `codefetch --list DS` |
161
- | `-R`, `--repos` | List public repositories for user | `codefetch --repos -u InzamamulQureshi` |
162
- | `-o`, `--output` | Specify destination output filename | `codefetch -r DS EXP1.c -o local.c` |
163
- | `--set-default` | Set persistent default repository | `codefetch --set-default DS` |
164
- | `--set-default-user` | Set persistent default user | `codefetch --set-default-user InzamamulQureshi` |
137
+ | `-s`, `--show` | Print file contents to terminal | `codefetch -s owner/repo main.py` |
138
+ | `-o`, `--output` | Specify destination output filename | `codefetch owner/repo main.py -o script.py` |
139
+ | `-l`, `--list` | List available code files in a repository | `codefetch -l owner/repo` |
140
+ | `-R`, `--repos` | List public repositories for a user | `codefetch -R -u username` |
141
+ | `-r`, `--repo` | Specify repository name or URL | `codefetch -r repo main.py` |
142
+ | `-u`, `--user` | Specify GitHub username or organization | `codefetch -u username -r repo main.py` |
143
+ | `-b`, `--branch` | Branch name (default: `main`) | `codefetch -b master owner/repo Makefile` |
144
+ | `--set-default` | Set persistent default repository | `codefetch --set-default owner/repo` |
145
+ | `--set-default-user` | Set persistent default user | `codefetch --set-default-user username` |
165
146
  | `--config` | Display active configuration | `codefetch --config` |
166
- | `--reset-config` | Reset configuration to defaults | `codefetch --reset-config` |
147
+ | `--reset-config` | Reset configuration back to defaults | `codefetch --reset-config` |
167
148
  | `-v`, `--version` | Display version information | `codefetch --version` |
168
149
  | `-h`, `--help` | Display help and usage message | `codefetch --help` |
169
150
 
@@ -171,6 +152,8 @@ codefetch --reset-config
171
152
 
172
153
  ## Supported File Extensions
173
154
 
155
+ CodeFetch recognizes and lists common source and document files:
156
+
174
157
  - **Data & Tables**: `.csv`, `.tsv`, `.json`, `.jsonl`, `.yaml`, `.yml`, `.toml`, `.xml`, `.ini`, `.cfg`, `.conf`, `.env`
175
158
  - **Data Science**: `.ipynb`, `.py`, `.r`, `.rmd`, `.m`
176
159
  - **Languages**: `.c`, `.cpp`, `.h`, `.hpp`, `.rs`, `.go`, `.java`, `.kt`, `.cs`, `.swift`, `.dart`, `.php`
@@ -0,0 +1,8 @@
1
+ codefetch/__init__.py,sha256=OgTOFFfQIh-gT-X8j2hheukYFmfAe0SvzIuA_LosY6Y,98
2
+ codefetch/cli.py,sha256=muL99Mr9tCPZ0UJp3YfVcVGMxTLvCPGfEbOmH-GpNCU,23588
3
+ codefetch_cli-1.2.2.dist-info/licenses/LICENSE,sha256=hqEPPm8jxPava5BfKIj3wTIXNyWNwsIvPv2daPCOijY,1094
4
+ codefetch_cli-1.2.2.dist-info/METADATA,sha256=pOL04v-tCvJap5vLYlCE9bDXBv768lm-LR5gghvyzlc,6000
5
+ codefetch_cli-1.2.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
6
+ codefetch_cli-1.2.2.dist-info/entry_points.txt,sha256=jFLRsBB_USeSdqjewcXZfnOzY56s0PZat7mnYkYdrXg,49
7
+ codefetch_cli-1.2.2.dist-info/top_level.txt,sha256=kHrftHbyqugb8LQXjW1dR9uI-JFjZQJ0sUReIa45yXQ,10
8
+ codefetch_cli-1.2.2.dist-info/RECORD,,
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Reaver101
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 InzamamulQureshi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,8 +0,0 @@
1
- codefetch/__init__.py,sha256=hbpjJJOuxVjNlJ4ZVpsQEyhLAepknLr6ugsa01sVVCU,98
2
- codefetch/cli.py,sha256=-Eg3K81jid2uXQ-sGA943HWHL92-WYNi3-Q6putdlEQ,22588
3
- codefetch_cli-1.2.1.dist-info/licenses/LICENSE,sha256=eztogQOJbUv4rWzTBEaVeMVQYzoaP1Ehs_vg-CqlpsM,1066
4
- codefetch_cli-1.2.1.dist-info/METADATA,sha256=LMZvjcTMWpMb6B3Qciy4hEoZXAFhAHJJ-Shxev11nrs,6117
5
- codefetch_cli-1.2.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
6
- codefetch_cli-1.2.1.dist-info/entry_points.txt,sha256=jFLRsBB_USeSdqjewcXZfnOzY56s0PZat7mnYkYdrXg,49
7
- codefetch_cli-1.2.1.dist-info/top_level.txt,sha256=kHrftHbyqugb8LQXjW1dR9uI-JFjZQJ0sUReIa45yXQ,10
8
- codefetch_cli-1.2.1.dist-info/RECORD,,