You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Codegen](https://docs.codegen.com) is a python library for manipulating codebases.
7
6
@@ -42,7 +41,7 @@ We built Codegen backwards from real-world refactors performed on enterprise cod
42
41
43
42
-**Natural mental model**: Write transforms that read like your thought process - "move this function", "rename this variable", "add this parameter". No more wrestling with ASTs or manual import management.
44
43
45
-
-**Battle-tested on complex codebases**: Handle Python, TypeScript, and React codebases with millions of lines of code. Built and validated on refactors at companies like [Ramp](https://ramp.com).
44
+
-**Battle-tested on complex codebases**: Handle Python, TypeScript, and React codebases with millions of lines of code.
46
45
47
46
-**Built for advanced intelligences**: As AI developers become more sophisticated, they need expressive yet precise tools to manipulate code. Codegen provides a programmatic interface that both humans and AI can use to express complex transformations through code itself.
Copy file name to clipboardExpand all lines: docs/building-with-codegen/files-and-directories.mdx
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,32 @@ dir = file.directory
50
50
exists = codebase.has_directory("path/to/dir")
51
51
```
52
52
53
+
## Working with Non-Code Files (README, JSON, etc.)
54
+
55
+
By default, Codegen focuses on source code files (Python, TypeScript, etc). However, you can access all files in your codebase, including documentation, configuration, and other non-code files like README.md, package.json, or .env:
56
+
57
+
```python
58
+
# Get all files in the codebase (including README, docs, config files)
59
+
files = codebase.files(extensions="*")
60
+
61
+
# Print files that are not source code (documentation, config, etc)
0 commit comments