View Source on Github
Attributes
classes
codeowners
current_commit
default_branch
directories
exports
external_modules
functions
github
global_vars
imports
interfaces
language
name
repo_path
symbols
types
Methods
ai
Generates a response from the AI based on the provided prompt, target, and context.View Source on Github
Parameters
checkout
Checks out a git branch or commit and syncs the codebase graph to the new state.View Source on Github
Parameters
commit
Commits all staged changes to the codebase graph and synchronizes the graph with the filesystem if specified.View Source on Github
Parameters
create_directory
Creates a directory at the specified path.View Source on Github
Parameters
create_file
Creates a new file in the codebase with specified content.View Source on Github
Parameters
create_pr
Creates a pull request from the current branch to the repository’s default branch.View Source on Github
Parameters
create_pr_comment
Create a comment on a pull requestView Source on Github
create_pr_review_comment
Create a review comment on a pull request.View Source on Github
files
A list property that returns all files in the codebase.View Source on Github
find_by_span
Finds editable objects that overlap with the given source code span.View Source on Github
Parameters
from_files
Creates a Codebase instance from multiple files.View Source on Github
from_repo
Fetches a codebase from GitHub and returns a Codebase instance.View Source on Github
Parameters
from_string
Creates a Codebase instance from a string of code.View Source on Github
get_class
Returns a class that matches the given name.View Source on Github
Parameters
get_directory
Returns Directory bydir_path, or full path to the directory from codebase root.
View Source on Github
Parameters
get_file
Retrieves a file from the codebase by its filepath.View Source on Github
Parameters
get_function
Retrieves a function from the codebase by its name.View Source on Github
Parameters
get_modified_symbols_in_pr
Get all modified symbols in a pull requestView Source on Github
get_relative_path
Calculates a relative path from one file to another, removing the extension from the target file.View Source on Github
Parameters
get_symbol
Returns a Symbol by name from the codebase.View Source on Github
Parameters
get_symbols
Retrieves all symbols in the codebase that match the given symbol name.View Source on Github
Parameters
git_commit
Stages + commits all changes to the codebase and git.View Source on Github
Parameters
has_directory
Returns a boolean indicating if a directory exists in the codebase.View Source on Github
Parameters
has_file
Determines if a file exists in the codebase.View Source on Github
Parameters
has_symbol
Returns whether a symbol exists in the codebase.View Source on Github
Parameters
reset
Resets the codebase byView Source on Github
set_ai_key
Sets the OpenAI key for the current Codebase instance.View Source on Github
set_session_options
Sets the session options for the current codebase.View Source on Github
Parameters
should_fix
Returns True if the flag should be fixed based on the current mode and active group.View Source on Github
Parameters
visualize
Visualizes a NetworkX graph or Plotly figure.View Source on Github