@@ -114,9 +114,9 @@ def init(global_: bool = False) -> None:
114114
115115 console .print ("\n [bold]Entity Manager Configuration[/bold]" )
116116 console .print ("Select the backend to use" , style = "dim" )
117- console .print ("Available backends: backlog, beads, github, markdown, notion, sqlite" , style = "dim" )
117+ console .print ("Available backends: backlog, beads, github, markdown, notion, redis, sqlite" , style = "dim" )
118118
119- valid_backends = ["backlog" , "beads" , "github" , "markdown" , "notion" , "sqlite" ]
119+ valid_backends = ["backlog" , "beads" , "github" , "markdown" , "notion" , "redis" , " sqlite" ]
120120 backend = None
121121 existing_backend = cfg .get ("backend" )
122122
@@ -131,7 +131,19 @@ def init(global_: bool = False) -> None:
131131
132132 config .set ("backend" , backend )
133133
134- if backend == "github" :
134+ if backend == "backlog" :
135+ existing_path = cfg .get ("backlog.path" )
136+ path = Prompt .ask ("Backlog.md path" , default = existing_path or "" )
137+ if path :
138+ config .set ("backlog.path" , path )
139+
140+ elif backend == "beads" :
141+ existing_path = cfg .get ("beads.project_path" )
142+ project_path = Prompt .ask ("Beads project path" , default = existing_path or "" )
143+ if project_path :
144+ config .set ("beads.project_path" , project_path )
145+
146+ elif backend == "github" :
135147 existing_owner = cfg .get ("github.owner" )
136148 owner = Prompt .ask ("GitHub owner" , default = existing_owner or "" )
137149 if owner :
@@ -146,11 +158,10 @@ def init(global_: bool = False) -> None:
146158 if token :
147159 config .set ("github.token" , token )
148160
149- elif backend == "beads" :
150- existing_path = cfg .get ("beads.project_path" )
151- project_path = Prompt .ask ("Beads project path" , default = existing_path or "" )
152- if project_path :
153- config .set ("beads.project_path" , project_path )
161+ elif backend == "markdown" :
162+ existing_path = cfg .get ("markdown.directory_path" )
163+ directory_path = Prompt .ask ("Markdown directory path" , default = existing_path or "." )
164+ config .set ("markdown.directory_path" , directory_path )
154165
155166 elif backend == "notion" :
156167 token = Prompt .ask ("Notion token" , password = True , default = "" )
@@ -162,23 +173,29 @@ def init(global_: bool = False) -> None:
162173 if database_id :
163174 config .set ("notion.database_id" , database_id )
164175
165- elif backend == "backlog" :
166- existing_path = cfg .get ("backlog.path" )
167- path = Prompt .ask ("Backlog.md path" , default = existing_path or "" )
168- if path :
169- config .set ("backlog.path" , path )
176+ elif backend == "redis" :
177+ existing_host = cfg .get ("redis.host" )
178+ host = Prompt .ask ("Redis host" , default = existing_host or "localhost" )
179+ config .set ("redis.host" , host )
180+
181+ existing_port = cfg .get ("redis.port" )
182+ port = Prompt .ask ("Redis port" , default = existing_port or "6379" )
183+ config .set ("redis.port" , port )
184+
185+ existing_db = cfg .get ("redis.db" )
186+ db = Prompt .ask ("Redis database number" , default = existing_db or "0" )
187+ config .set ("redis.db" , db )
188+
189+ password = Prompt .ask ("Redis password (leave empty if none)" , password = True , default = "" )
190+ if password :
191+ config .set ("redis.password" , password )
170192
171193 elif backend == "sqlite" :
172194 existing_path = cfg .get ("sqlite.db_path" )
173195 db_path = Prompt .ask ("SQLite database path" , default = existing_path or ".em.db" )
174196 if db_path :
175197 config .set ("sqlite.db_path" , db_path )
176198
177- elif backend == "markdown" :
178- existing_path = cfg .get ("markdown.directory_path" )
179- directory_path = Prompt .ask ("Markdown directory path" , default = existing_path or "." )
180- config .set ("markdown.directory_path" , directory_path )
181-
182199 else :
183200 console .print (f"Unknown backend: { backend } " , style = "red" )
184201 return
0 commit comments